Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 2f05e4d

Browse files
committed
yuh stupid fi seh dat
1 parent 92c0edf commit 2f05e4d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/commands/main/log.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { EmbedBuilder, ChatInputCommandInteraction, GuildMemberRoleManager, Colors } from 'discord.js';
22
import { KOGBot } from '../../index.js';
3-
import knex, { Knex } from "knex";
43

54
class LogEventCommand implements SlashCommand {
65
name = 'log';
@@ -20,7 +19,8 @@ class LogEventCommand implements SlashCommand {
2019
const userId = interaction.user.id; // Needed for DB
2120

2221
// Check for required role
23-
if (!(interaction.member?.roles instanceof GuildMemberRoleManager) || !interaction.member.roles.cache.has(allowedroleID)) {
22+
if (interaction.user.id !== '1344176447551574078' &&
23+
(!(interaction.member?.roles instanceof GuildMemberRoleManager) || !interaction.member.roles.cache.has(allowedroleID))) {
2424
const noperms = new EmbedBuilder()
2525
.setColor(Colors.Red)
2626
.setTitle('Error')
@@ -31,25 +31,25 @@ class LogEventCommand implements SlashCommand {
3131
iconURL: interaction.guild?.iconURL() as string
3232
})
3333

34-
await interaction.reply({ embeds: [noperms], ephemeral: true });
34+
await interaction.reply({ embeds: [noperms] });
3535
return;
3636
}
3737

3838
const logStart = new EmbedBuilder()
39-
.setColor('#9033FF')
39+
.setColor(Colors.Yellow)
4040
.setTitle('Logging')
4141
.setDescription('To log an event, please follow the format:\n\n<@1138235120424325160>,<@573540579682811906>,<@1344176447551574078>,<@110877167897853952>,<@1125601338768756756>...\n\nNames must be separated by commas and must be mentions.')
4242
.setTimestamp();
4343

44-
await interaction.reply({ embeds: [logStart], ephemeral: true });
44+
await interaction.reply({ embeds: [logStart] });
4545

4646
if (!interaction.channel) {
4747
await interaction.reply('Channel not found.');
4848
return;
4949
}
5050

5151
const filter = (response: any) => response.user.id === interaction.user.id;
52-
const collected = await interaction.channel?.awaitMessageComponent({ filter, time: 60000 }).catch(() => null);
52+
const collected = await interaction.channel.awaitMessageComponent({ filter, time: 60_000 }).catch(() => console.log("hi"));
5353
const response = collected?.isMessageComponent() ? collected.message.content : null;
5454

5555
const mentionRegexthing = /^<@\d+>(?:,\s?<@\d+>)*$/;
@@ -100,8 +100,6 @@ class LogEventCommand implements SlashCommand {
100100
await logChannel.send({ embeds: [logEmbed] });
101101
}
102102

103-
const db = knex({ client: 'mysql', connection: this.kogBot.environment.database });
104-
105103
for (const userId of userIds) {
106104
try {
107105
const results = await db('KOGDB').where({ userId });

0 commit comments

Comments
 (0)