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) {
this.text = await this.escapeDiscordPing(
discord_message.content,
discordClient
discordClient,
);
this.text += discord_message.attachments.map((a) => a.url).join("\n");
console.log("escaped text", this.text);
this.channel = discord_message.channelId;
this.author = discord_message.author.displayName;
@ -54,7 +55,7 @@ export class Message {
return res_text;
}
copy(msg){
copy(msg) {
this.text = msg.text;
this.channel = msg.channel;
this.author = msg.author;

View file

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

View file

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