handle discord attachement
This commit is contained in:
parent
bea6ed2fe2
commit
62ed5c67b1
3 changed files with 59 additions and 59 deletions
|
|
@ -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;
|
||||||
|
|
@ -54,7 +55,7 @@ export class Message {
|
||||||
return res_text;
|
return res_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
copy(msg){
|
copy(msg) {
|
||||||
this.text = msg.text;
|
this.text = msg.text;
|
||||||
this.channel = msg.channel;
|
this.channel = msg.channel;
|
||||||
this.author = msg.author;
|
this.author = msg.author;
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"verbose": true,
|
"verbose": true,
|
||||||
"discordChannels": ["1161739009614151751", "727212463988146206"],
|
"discordChannels": ["1335942797726846989", "1335962777063264326"],
|
||||||
"ircChannels": ["#urlab"]
|
"ircChannels": ["#vincentdev"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue