Skip to content

Commit

Permalink
Set bot's activity (#37)
Browse files Browse the repository at this point in the history
This sets the bot activity to "/horaires trams & bus" which should enable users to know about the bot's purpose as well as how to use it.
  • Loading branch information
PopFlamingo authored Sep 9, 2022
1 parent 253b773 commit e7d1698
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require("dotenv").config();

(async () => {
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

// Store token in a variable from the DISCORD_TOKEN environment variable
const token = process.env.DISCORD_TOKEN;

Expand Down Expand Up @@ -147,5 +148,12 @@ require("dotenv").config();
});

// Login to Discord
client.login(token);
await client.login(token);

// Set activity to the name of the main command
if (client.user !== null) {
client.user.setActivity('/horaires trams & bus', { type: 'PLAYING' });
} else {
console.error("Unexpected null client.user")
}
})();

0 comments on commit e7d1698

Please sign in to comment.