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}`);
|
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
|
// 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]);
|
if (eventName === 'interactionCreate') args[0] = new InteractionWrapper(this.target, args[0]);
|
||||||
|
|
||||||
|
@ -22,12 +22,15 @@ class Intercom {
|
|||||||
|
|
||||||
_transportCommands() {
|
_transportCommands() {
|
||||||
|
|
||||||
|
const clientId = this.client.application.id;
|
||||||
const commands = this.client.registry.components
|
const commands = this.client.registry.components
|
||||||
.filter((c) => c._type === 'command' && c.slash)
|
.filter((c) => c._type === 'command' && c.slash)
|
||||||
.map((c) => c.shape);
|
.map((c) => c.shape);
|
||||||
|
|
||||||
// this.send('commands', { type: 'global', commands });
|
if (process.env.NODE_ENV === 'development') return this.send('commands', { type: 'guild', commands, clientId });
|
||||||
this.send('commands', { type: 'guild', commands, clientId: this.client.application.id });
|
|
||||||
|
this.send('commands', { type: 'global', commands, clientId });
|
||||||
|
this.send('commands', { type: 'guild', commands, clientId });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
const { Observer, Infraction } = require("../../interfaces");
|
const { Observer, Infraction } = require("../../interfaces");
|
||||||
const { GuildWrapper } = require("../../client/wrappers");
|
|
||||||
|
|
||||||
class AuditLogObserver extends Observer {
|
class AuditLogObserver extends Observer {
|
||||||
|
|
||||||
|
@ -42,8 +42,6 @@ class GuildLogger extends Observer {
|
|||||||
['messageDeleteBulk', this.messageDeleteBulk.bind(this)],
|
['messageDeleteBulk', this.messageDeleteBulk.bind(this)],
|
||||||
['messageUpdate', this.messageEdit.bind(this)],
|
['messageUpdate', this.messageEdit.bind(this)],
|
||||||
['voiceStateUpdate', this.voiceState.bind(this)],
|
['voiceStateUpdate', this.voiceState.bind(this)],
|
||||||
//['guildBanAdd', this.ban.bind(this)],
|
|
||||||
//['guildBanRemove', this.unban.bind(this)],
|
|
||||||
['guildMemberAdd', this.memberJoin.bind(this)],
|
['guildMemberAdd', this.memberJoin.bind(this)],
|
||||||
['guildMemberRemove', this.memberLeave.bind(this)],
|
['guildMemberRemove', this.memberLeave.bind(this)],
|
||||||
['guildMemberUpdate', this.memberUpdate.bind(this)]
|
['guildMemberUpdate', this.memberUpdate.bind(this)]
|
||||||
@ -559,23 +557,15 @@ class GuildLogger extends Observer {
|
|||||||
this.client.rateLimiter.queueSend(logChannel, wrapper.format(index, langParams).trim());
|
this.client.rateLimiter.queueSend(logChannel, wrapper.format(index, langParams).trim());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// async ban(guild, user) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// async unban(guild, user) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
_replaceTags(text, member) {
|
_replaceTags(text, member) {
|
||||||
const { user, guild } = member;
|
const { user, guild } = member;
|
||||||
return text
|
return text
|
||||||
.replace(/\{mention\}/gu, `<@${member.id}>`)
|
.replace(/\{mention\}/gu, `<@${member.id}>`)
|
||||||
.replace(/\{tag\}/gu, Util.escapeMarkdown(user.tag))
|
.replace(/\{tag\}/gu, Util.escapeMarkdown(user.tag))
|
||||||
.replace(/\{username\}/gu, Util.escapeMarkdown(user.username))
|
.replace(/\{username\}/gu, Util.escapeMarkdown(user.username))
|
||||||
.replace(/\{serversize\}/gu, guild.memberCount)
|
.replace(/\{guildsize\}/gu, guild.memberCount)
|
||||||
.replace(/\{servername\}/gu, guild.name)
|
.replace(/\{guildname\}/gu, guild.name)
|
||||||
.replace(/\{accage\}/gu, Util.humanise((Date.now() - user.createdTimestamp)/1000)) //.replace(/a/, '1')
|
.replace(/\{accage\}/gu, Util.humanise((Date.now() - user.createdTimestamp)/1000)) //.replace(/a/, '1')
|
||||||
.replace(/\{id\}/gu, user.id)
|
.replace(/\{id\}/gu, user.id)
|
||||||
.trim();
|
.trim();
|
||||||
@ -646,7 +636,7 @@ class GuildLogger extends Observer {
|
|||||||
color: CONSTANTS.COLORS.BLUE
|
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;
|
actionObject.trigger = actionObject.type;
|
||||||
|
|
||||||
|
@ -90,7 +90,8 @@ class Setting extends Component {
|
|||||||
hook.collector = await this.collector(wrapper, selectMenu);
|
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 = [];
|
const fields = [];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user