handle discord attachement

This commit is contained in:
vincent 2025-03-04 22:03:51 +01:00
parent bea6ed2fe2
commit 62ed5c67b1
3 changed files with 59 additions and 59 deletions

View file

@ -9,8 +9,9 @@ export class Message {
async fromDiscordFormat(discord_message, discordClient) { async fromDiscordFormat(discord_message, discordClient) {
this.text = await this.escapeDiscordPing( this.text = await this.escapeDiscordPing(
discord_message.content, discord_message.content,
discordClient discordClient,
); );
this.text += discord_message.attachments.map((a) => a.url).join("\n");
console.log("escaped text", this.text); console.log("escaped text", this.text);
this.channel = discord_message.channelId; this.channel = discord_message.channelId;
this.author = discord_message.author.displayName; this.author = discord_message.author.displayName;

View file

@ -19,7 +19,6 @@ class DiscordClient extends Client {
this.trackedChannelsIds = channels; this.trackedChannelsIds = channels;
this.trackedChannels = new Map(); this.trackedChannels = new Map();
this.channelsGuilds = new Map(); this.channelsGuilds = new Map();
this.guildsMembers = new Map();
this.on("messageCreate", (msg) => { this.on("messageCreate", (msg) => {
this.log("message recived", msg); this.log("message recived", msg);

View file

@ -1,5 +1,5 @@
{ {
"verbose": true, "verbose": true,
"discordChannels": ["1161739009614151751", "727212463988146206"], "discordChannels": ["1335942797726846989", "1335962777063264326"],
"ircChannels": ["#urlab"] "ircChannels": ["#vincentdev"]
} }