mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 04:10:59 -05:00
Some tweaks here and there
This commit is contained in:
parent
1df6004a32
commit
77a382b990
@ -2,10 +2,10 @@ import Discord from 'discord.js';
|
|||||||
import TClient from '../client';
|
import TClient from '../client';
|
||||||
export default {
|
export default {
|
||||||
async run(client:TClient, messages:Discord.Collection<string, Discord.Message<boolean>>){
|
async run(client:TClient, messages:Discord.Collection<string, Discord.Message<boolean>>){
|
||||||
const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel;
|
|
||||||
if (!client.config.botSwitches.logs) return;
|
if (!client.config.botSwitches.logs) return;
|
||||||
if ((client.guilds.cache.get('929807948748832798') as Discord.Guild)?.id != client.config.mainServer.id) return;
|
if (client.config.mainServer.id != '468835415093411861') return;
|
||||||
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setTitle(`${messages.size} messages were purged`).setDescription(`\`\`\`${messages.map((msgs)=>`${msgs.member.displayName}: ${msgs.content}`).reverse().join('\n').slice(0,3900)}\`\`\``).addFields({name: 'Channel', value: `<#${(messages.first() as Discord.Message).channel.id}>`});
|
const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel;
|
||||||
|
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setTitle(`${messages.size} messages were purged`).setDescription(`\`\`\`${messages.map((msgs)=>`${msgs.member.displayName}: ${msgs.content}`).reverse().join('\n').slice(0,3900)}\`\`\``).addFields({name: 'Channel', value: `<#${messages.first().channel.id}>`});
|
||||||
channel.send({embeds: [embed]})
|
channel.send({embeds: [embed]})
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -90,7 +90,7 @@ export class punishments extends Database {
|
|||||||
if (data.cancels) embed.addFields({name: '🔹 Overwrites', value: `This case overwrites Case #${cancels.id}\n\`${cancels.reason}\``});
|
if (data.cancels) embed.addFields({name: '🔹 Overwrites', value: `This case overwrites Case #${cancels.id}\n\`${cancels.reason}\``});
|
||||||
|
|
||||||
// send embed in modlog channel
|
// send embed in modlog channel
|
||||||
(this.client.channels.cache.get(channelId) as Discord.TextChannel).send({embeds: [embed]});
|
(this.client.channels.resolve(channelId) as Discord.TextChannel).send({embeds: [embed]});
|
||||||
};
|
};
|
||||||
getTense(type: string) { // Get past tense form of punishment type, grammar yes
|
getTense(type: string) { // Get past tense form of punishment type, grammar yes
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -141,7 +141,7 @@ export class punishments extends Database {
|
|||||||
if (['ban', 'softban'].includes(type)) {
|
if (['ban', 'softban'].includes(type)) {
|
||||||
const banned = await guild.bans.fetch(User.id).catch(() => undefined);
|
const banned = await guild.bans.fetch(User.id).catch(() => undefined);
|
||||||
if (!banned) {
|
if (!banned) {
|
||||||
punResult = await guild.bans.create(User.id, {reason: `${reason} | Case #${punData.id}`}).catch((err: Error) => err.message);
|
punResult = await guild.bans.create(User.id, {reason: `${reason} | Case #${punData.id}`, deleteMessageSeconds: 172800}).catch((err: Error) => err.message);
|
||||||
} else {
|
} else {
|
||||||
punResult = 'User is already banned.';
|
punResult = 'User is already banned.';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user