Skip to content

Commit

Permalink
refactor: use descriptive event param names (#1542)
Browse files Browse the repository at this point in the history
  • Loading branch information
codershiba authored May 22, 2024
1 parent bea3d8e commit 88764cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guide/miscellaneous/useful-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ const { Client, Events, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
const logger = require('./logger');

client.on(Events.ClientReady, () => logger.info('The bot is online'));
client.on(Events.Debug, m => logger.debug(m));
client.on(Events.Warn, m => logger.warn(m));
client.on(Events.Error, m => logger.error(m));
client.once(Events.ClientReady, () => logger.info('The bot is online'));
client.on(Events.Debug, info => logger.debug(info));
client.on(Events.Warn, info => logger.warn(info));
client.on(Events.Error, error => logger.error(error));

client.login('your-token-goes-here');
```
Expand Down

0 comments on commit 88764cf

Please sign in to comment.