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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 192 - (hide annotations)
Mon Jul 29 17:28:57 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 696 byte(s)
fix: typescript issues in ModerationEmbed class
1 rakin 187 import { MessageEmbed, User, MessageEmbedOptions } from 'discord.js';
2    
3 rakin 192 export default class ModerationEmbed extends MessageEmbed {
4 rakin 187 constructor(protected user: User, protected mod: User, options?: MessageEmbedOptions) {
5     super({
6     author: {
7     name: user.tag,
8     iconURL: user.displayAvatarURL()
9     },
10     ...options
11     });
12    
13 rakin 192 this.addField('Executor', `Tag: ${mod.tag}\nID: ${mod.id}`);
14 rakin 187
15     this.setFooter({
16     text: `${user.id}`
17     });
18    
19     this.setTimestamp();
20    
21     this.setColor('#007bff');
22     }
23 rakin 188
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 rakin 192
32     return this;
33 rakin 188 }
34 rakin 187 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26