Skip to content

Commit

Permalink
Fix: intents and events
Browse files Browse the repository at this point in the history
  • Loading branch information
papey committed Mar 28, 2022
1 parent 6be63c4 commit 57de6c1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export class Trostani {
this.verifyConfig();
// Create a Discord client class
this.client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGES,
],
partials: ["CHANNEL"],
});

this.logger = log.getLogger("bot");
Expand All @@ -59,7 +64,7 @@ export class Trostani {
// Setup routes to commands
private routes() {
// When a message is received
this.client.on("message", (message: Message) => {
this.client.on("messageCreate", (message: Message) => {
if (
// it's not the bot who sends the original message
message.author.id != this.client.user.id &&
Expand Down

0 comments on commit 57de6c1

Please sign in to comment.