Welcome to the Discord Logging Bot template! This template is designed to help you create a bot that can log messages to a specific channel on your Discord server. It's perfect for server administrators who want to keep track of important events or messages. The bot can be easily controlled via commands, allowing you to set a log channel and send messages to it.
To begin using this template, simply click on "Start with this Template" on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy or paste any code manually.
Before you can use the bot, you need to set up an environment secret for the Discord bot token. This token allows your bot to interact with the Discord API.
DISCORD_BOT_TOKEN
and paste the bot token you copied as the value.Once you have set up the environment secret, press the "Test" button in the Lazy platform. This will deploy your application and launch the Lazy CLI. The bot will start, and you should see a confirmation in the CLI that it has logged in successfully.
There is no need for user input through the CLI for this template, as all commands are given directly within Discord.
After deploying the bot, you can interact with it on your Discord server. Make sure to invite the bot to your server using the OAuth2 URL generated in the Discord Developer Portal.
To fully integrate the bot into your Discord server, follow these steps:
!set_log_channel #channel-name
command in Discord to set the channel where you want the logs to be sent. Replace #channel-name
with the actual channel you wish to use.!log message
command to send a log message to that channel. Replace message
with the content you want to log.Remember, you must have administrator permissions on the Discord server to use these commands.
That's it! Your Discord Logging Bot is now set up and ready to use. Enjoy your new logging capabilities on your Discord server.
If you need further assistance or have any questions, please refer to the discord.py documentation.
The Discord bot monitors all messages in the server. If a message contains profanity, the bot deletes it and sends a warning to the channel. The bot also notifies the host about the deletion via a direct message. Additionally, the bot outputs a helpful error message to a channel if there is a permissions error, guiding the server admin to enable the required permission in the Discord Developer portal.