forked from Galactic/galactic-bot
cleanup
This commit is contained in:
parent
a7bad04495
commit
6c19c57631
@ -47,7 +47,9 @@ class EventHooker {
|
||||
|
||||
this.logger.debug(`Handler ${eventName}`);
|
||||
// Should probably move this elsewhere, but testing this out -- or maybe not, might be the most appropriate place for this
|
||||
for (const arg of args) if (arg?.guild) arg.guildWrapper = this.target.getGuildWrapper(arg.guild.id);
|
||||
for (const arg of args) {
|
||||
if (arg?.guild) arg.guildWrapper = this.target.getGuildWrapper(arg.guild.id);
|
||||
}
|
||||
|
||||
if (eventName === 'interactionCreate') args[0] = new InteractionWrapper(this.target, args[0]);
|
||||
|
||||
|
@ -22,12 +22,15 @@ class Intercom {
|
||||
|
||||
_transportCommands() {
|
||||
|
||||
const clientId = this.client.application.id;
|
||||
const commands = this.client.registry.components
|
||||
.filter((c) => c._type === 'command' && c.slash)
|
||||
.map((c) => c.shape);
|
||||
|
||||
// this.send('commands', { type: 'global', commands });
|
||||
this.send('commands', { type: 'guild', commands, clientId: this.client.application.id });
|
||||
if (process.env.NODE_ENV === 'development') return this.send('commands', { type: 'guild', commands, clientId });
|
||||
|
||||
this.send('commands', { type: 'global', commands, clientId });
|
||||
this.send('commands', { type: 'guild', commands, clientId });
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
const { Observer, Infraction } = require("../../interfaces");
|
||||
const { GuildWrapper } = require("../../client/wrappers");
|
||||
|
||||
class AuditLogObserver extends Observer {
|
||||
|
||||
|
@ -42,8 +42,6 @@ class GuildLogger extends Observer {
|
||||
['messageDeleteBulk', this.messageDeleteBulk.bind(this)],
|
||||
['messageUpdate', this.messageEdit.bind(this)],
|
||||
['voiceStateUpdate', this.voiceState.bind(this)],
|
||||
//['guildBanAdd', this.ban.bind(this)],
|
||||
//['guildBanRemove', this.unban.bind(this)],
|
||||
['guildMemberAdd', this.memberJoin.bind(this)],
|
||||
['guildMemberRemove', this.memberLeave.bind(this)],
|
||||
['guildMemberUpdate', this.memberUpdate.bind(this)]
|
||||
@ -560,22 +558,14 @@ class GuildLogger extends Observer {
|
||||
|
||||
}
|
||||
|
||||
// async ban(guild, user) {
|
||||
|
||||
// }
|
||||
|
||||
// async unban(guild, user) {
|
||||
|
||||
// }
|
||||
|
||||
_replaceTags(text, member) {
|
||||
const { user, guild } = member;
|
||||
return text
|
||||
.replace(/\{mention\}/gu, `<@${member.id}>`)
|
||||
.replace(/\{tag\}/gu, Util.escapeMarkdown(user.tag))
|
||||
.replace(/\{username\}/gu, Util.escapeMarkdown(user.username))
|
||||
.replace(/\{serversize\}/gu, guild.memberCount)
|
||||
.replace(/\{servername\}/gu, guild.name)
|
||||
.replace(/\{guildsize\}/gu, guild.memberCount)
|
||||
.replace(/\{guildname\}/gu, guild.name)
|
||||
.replace(/\{accage\}/gu, Util.humanise((Date.now() - user.createdTimestamp)/1000)) //.replace(/a/, '1')
|
||||
.replace(/\{id\}/gu, user.id)
|
||||
.trim();
|
||||
@ -646,7 +636,7 @@ class GuildLogger extends Observer {
|
||||
color: CONSTANTS.COLORS.BLUE
|
||||
};
|
||||
|
||||
logChannel.send({ embed });
|
||||
logChannel.send({ embeds: [embed] });
|
||||
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ class WordWatcher extends FilterSetting {
|
||||
|
||||
}
|
||||
|
||||
_createTrigger(interaction, action, actionObject, actions) {
|
||||
_createTrigger(interaction, action, actionObject) {
|
||||
|
||||
actionObject.trigger = actionObject.type;
|
||||
|
||||
|
@ -90,7 +90,8 @@ class Setting extends Component {
|
||||
hook.collector = await this.collector(wrapper, selectMenu);
|
||||
}
|
||||
|
||||
usageEmbed(guild, verbose = false) {
|
||||
// , verbose = false -- unsure if this is a necessary argument anymore
|
||||
usageEmbed(guild) {
|
||||
|
||||
const fields = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user