/[sudobot]/trunk/src/automod/Logger.ts
ViewVC logotype

Diff of /trunk/src/automod/Logger.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 57 by rakin, Mon Jul 29 17:28:24 2024 UTC revision 58 by rakin, Mon Jul 29 17:28:25 2024 UTC
# Line 1  Line 1 
1  import { roleMention } from '@discordjs/builders';  import { roleMention } from '@discordjs/builders';
2  import { GuildBan, GuildMember, Message, MessageEmbed, TextChannel, User } from 'discord.js';  import { FileOptions, GuildBan, GuildMember, Message, MessageEmbed, TextChannel, User } from 'discord.js';
3  import DiscordClient from '../client/Client';  import DiscordClient from '../client/Client';
4  import { timeProcess, timeSince } from '../utils/util';  import { timeProcess, timeSince } from '../utils/util';
5    
# Line 65  class Logger { Line 65  class Logger {
65                      text: "Deleted",                      text: "Deleted",
66                  })                  })
67                  .setTimestamp();                  .setTimestamp();
68                
69                const files: FileOptions[] = [];
70    
71              if (msg.attachments.size > 0) {              if (msg.attachments.size > 0) {
72                  let str = '';                  let str = '';
73    
74                  msg.attachments.forEach(a => {                  msg.attachments.forEach(a => {
75                      str += `**${a.name}** ${a.url}\n`;                      str += `${a.name}\n`;
76                        files.push({
77                            name: a.name!,
78                            attachment: a.proxyURL
79                        });
80                  });                  });
81    
82                  embed.addField('Attachments', str);                  embed.addField('Attachments (top)', str);
83              }              }
84    
85              await channel.send({              await channel.send({
86                  embeds: [                  embeds: [
87                      embed                      embed
88                  ]                  ],
89                    files
90              });              });
91          }, msg);          }, msg);
92      }      }

Legend:
Removed from v.57  
changed lines
  Added in v.58

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26