Skip to content

Commit edd8fa4

Browse files
committed
No fokin way i updated dat shet
1 parent daaadf1 commit edd8fa4

2 files changed

Lines changed: 17 additions & 20 deletions

File tree

src/handler/Handler.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Client, ChannelType, PermissionFlagsBits } from 'discord.js';
1+
import { ChannelType, Client, Events, Message, PermissionFlagsBits } from 'discord.js';
22

3-
import Event from './Event'
4-
import Command from './Command'
5-
import Utils from '../Utils'
3+
import Event from './Event';
4+
import Command from './Command';
5+
import Utils from '../Utils';
66
import Feature from './Feature';
77
import prisma from '../lib/prisma';
88

@@ -192,7 +192,8 @@ class Handler {
192192
}
193193

194194
// Handle commands
195-
this.client.on('messageCreate', async message => {
195+
this.client.on(Events.MessageCreate, async (message: Message) => {
196+
if (message.channel.type === ChannelType.GroupDM) return;
196197
const guildSettings = await prisma.guild.upsert({
197198
where: {
198199
id: message.guildId,
@@ -224,24 +225,19 @@ class Handler {
224225
return;
225226
}
226227

227-
if (cmd.adminOnly && message.author.id !== '263349725099458566' && (message.channel.type === ChannelType.DM || !message.member.permissions.has('Administrator'))) {
228-
return;
228+
if (cmd.adminOnly &&
229+
message.author.id !== "263349725099458566" &&
230+
(
231+
message.channel.type === ChannelType.DM ||
232+
!message.member.permissions.has(PermissionFlagsBits.Administrator))
233+
) {
234+
return;
229235
}
230-
if (cmd.adminOnly &&
231-
message.author.id !== "263349725099458566" &&
232-
(
233-
message.channel.type === ChannelType.DM ||
234-
!message.member.permissions.has(PermissionFlagsBits.Administrator))
235-
) {
236-
return;
237-
}
238-
239236

240237
if (cmd.guildOnly && !message.guild) {
241238
return;
242239
}
243240

244-
245241
try {
246242
await cmd.run(message, args);
247243
console.log(`[LOG] ${message.author.tag} использовал ${cmd.name}`)

src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import path from 'path'
1+
import path from 'path';
22
import { Client, GatewayIntentBits, Partials } from 'discord.js';
33
import { Handler } from './handler';
4-
import dotenv from 'dotenv'
4+
import dotenv from 'dotenv';
55

66
dotenv.config({ path: path.join(__dirname, '.env') })
77

88
const client = new Client({
99
intents: [
1010
GatewayIntentBits.GuildMembers, GatewayIntentBits.DirectMessages,
1111
GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages,
12-
GatewayIntentBits.GuildMessageReactions
12+
GatewayIntentBits.GuildMessageReactions,
13+
GatewayIntentBits.MessageContent,
1314
],
1415
partials: [Partials.Channel, Partials.Reaction, Partials.Message],
1516
});

0 commit comments

Comments
 (0)