README update

This commit is contained in:
2026-03-01 00:26:39 -05:00
parent a07c071dc2
commit ef441d3281

View File

@@ -21,17 +21,21 @@ import (
/* /*
A basic example of a bot with two commands and a general message handler for non-command messages. The bot uses a A basic example of a bot with two commands and a general message handler for non-command messages. The bot uses a
verbose log level which will log everything for debugging purposes, and registers Discord Intents for message and admin verbose log level which will log everything for debugging purposes, and registers Discord Intents for message and
related permissions. This allows the bot to parse messages, send them, delete them, etc. as well as timeout and mute users. admin related permissions. This allows the bot to parse messages, send them, delete them, etc. as well as timeout
and mute users.
This example registers three commands: This example registers three commands:
1. .ping - a basic ping/pong command that can be run by anyone at any time 1. .ping - a basic ping/pong command that can be run by anyone at any time
2. .wait - a dummy command that replies "okay" it can only be run by users with the "user" role and can only be ran once every 25 seconds 2. .wait - a dummy command that replies "okay" it can only be run by users with the "user" role and can only be ran
3. .timeout - a admin command that can only be run by users with an "admin" role, this command will timeout any mentioned users for 5 minutes once every 25 seconds
3. .timeout - a admin command that can only be run by users with an "admin" role, this command will timeout any mentioned
users for 5 minutes
A message handler is also registered in this example, message handlers are used to handle messages that do not contain a command. This enables A message handler is also registered in this example, message handlers are used to handle messages that do not contain a
auto-moderation from the bot without manual intervention. The example message handler does two arbitrary things to demo functionality: command. This enables auto-moderation from the bot without manual intervention. The example message handler does two arbitrary
things to demo functionality:
1. Checks the message content for the phrase "swear word" and, if found, times the user out for 5 minutes 1. Checks the message content for the phrase "swear word" and, if found, times the user out for 5 minutes
2. Checks the message for the phrase "im going to yell in VoiceChat" and mutes the message author until Unmute is called on them 2. Checks the message for the phrase "im going to yell in VoiceChat" and mutes the message author until Unmute is called on them