/[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 214 by rakin, Mon Jul 29 17:29:03 2024 UTC revision 227 by rakin, Mon Jul 29 17:29:07 2024 UTC
# Line 1  Line 1 
1  import { roleMention } from '@discordjs/builders';  import { roleMention } from '@discordjs/builders';
2  import { BanOptions, CommandInteraction, FileOptions, Guild, GuildBan, GuildMember, Message, MessageEmbed, TextChannel, User } from 'discord.js';  import { BanOptions, CommandInteraction, FileOptions, Guild, GuildBan, GuildMember, Message, MessageEmbed, MessageOptions, MessagePayload, TextChannel, User } from 'discord.js';
3  import ms from 'ms';  import ms from 'ms';
4  import DiscordClient from '../client/Client';  import DiscordClient from '../client/Client';
5  import Punishment from '../models/Punishment';  import Punishment from '../models/Punishment';
# Line 30  class Logger { Line 30  class Logger {
30          }          }
31      }      }
32    
33        async send(guild: Guild, messageOptions: MessageOptions | MessagePayload | string) {
34            let channelID = this.client.config.props[guild!.id].logging_channel;
35            let channel = guild!.channels.cache.find((c: any) => c.id === channelID) as TextChannel;
36    
37            if (channel) {
38                return await channel.send(messageOptions);
39            }
40        }
41    
42      log(guild: Guild, callback: (channel: TextChannel) => any) {      log(guild: Guild, callback: (channel: TextChannel) => any) {
43          this.channel(callback, { guild });          this.channel(callback, { guild });
44      }      }

Legend:
Removed from v.214  
changed lines
  Added in v.227

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26