/[sudobot]/trunk/src/utils/ModerationEmbed.ts
ViewVC logotype

Diff of /trunk/src/utils/ModerationEmbed.ts

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

revision 187 by rakin, Mon Jul 29 17:28:56 2024 UTC revision 192 by rakin, Mon Jul 29 17:28:57 2024 UTC
# Line 1  Line 1 
1  import { MessageEmbed, User, MessageEmbedOptions } from 'discord.js';  import { MessageEmbed, User, MessageEmbedOptions } from 'discord.js';
2    
3  export class ModerationEmbed extends MessageEmbed {  export default class ModerationEmbed extends MessageEmbed {
4      constructor(protected user: User, protected mod: User, options?: MessageEmbedOptions) {      constructor(protected user: User, protected mod: User, options?: MessageEmbedOptions) {
5          super({          super({
6              author: {              author: {
# Line 10  export class ModerationEmbed extends Mes Line 10  export class ModerationEmbed extends Mes
10              ...options              ...options
11          });          });
12                    
13          this.addField('Executor', [          this.addField('Executor', `Tag: ${mod.tag}\nID: ${mod.id}`);
             `Tag: ${mod.tag}`,  
             `ID: ${mod.id}`  
         ]);  
14    
15          this.setFooter({          this.setFooter({
16              text: `${user.id}`              text: `${user.id}`
# Line 23  export class ModerationEmbed extends Mes Line 20  export class ModerationEmbed extends Mes
20                    
21          this.setColor('#007bff');          this.setColor('#007bff');
22      }      }
23    
24        public setReason(reason: string | null | undefined) {
25            if (reason) {
26                this.addField('Reason', reason);
27            }
28            else {
29                this.addField('Reason', '*No reason provided*');
30            }
31    
32            return this;
33        }
34  }  }

Legend:
Removed from v.187  
changed lines
  Added in v.192

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26