Bot
Interact with discord using a bot.
Step 1 Create a Bot
Go to the Discord Developer Portal. https://discord.com/developers/applications
Go to applications.
Click
new application
.Click
Bot.
Click
Reset Token
.Copy token.
Enable
Privileged Gateway Intents.
(I recommend enabling them all)
Step 2 Invite Bot to Server
Open this website https://discordapi.com/permissions.html
Select the permissions the bot should have. (I recommend just giving admin)
Copy the client ID from the application.
Click the generated link on the calculator.
Invite the bot to the server.
Step 3 Register Bot with Leaf
In the
config.yml
paste the bot's token into thediscord_token
field.Restart the proxy server.
You're done!
Customise your Bot!
Commands that support discord bots:
Chat (Example: Add a staff chat channel)
Find (Example: /find in discord)
Info (Example: /info in discord)
List (Example: /stafflist in discord)
Servers (Example: /servers in discord)
Command (Example: /ban in discord)
Discord Events:
Discordmessage (Link text channels to minecraft)
Discord Command Defaults
command_identnfier:
enabled: true
...
# The discord bot section.
discord_bot:
# [REQUIRED] → Discord Command Toggle
enabled: true
# [OPTIONAL] → When a member returns null.
member_error": "An error occurred while trying to get the member instance."
# [OPTIONAL] → Allowed Channels
# Specifiy channels that this command
# is only allowed to be executed in.
allowed_channels:
- "1150803388309712947"
channel_not_allowed: "You cannot run this command in this channel."
# [OPTIONAL] → Discord Permissions.
# The discord member must have all of
# these permissions to use this command.
permissions:
- ADMINISTRATOR
no_permission: "You do not have permission to run this command."
# [OPTIONAL] → Discord Roles.
# The discord member must have at least 1 of
# these role names.
roles:
- "Owner"
- "Moderator"
no_roles": "You do not have the correct roles to run this command."
discord_members:
- "548674771013861381"
no_discord_id: "You are not allowed to execute this command"
# [OPTIONAL] → Discord Command Limit
# Limit the amount of times a discord member can
# execute this command.
# No Limit = -1.
limit: -1
# [OPTIONAL] → Delete after seconds
# The amount of time the plugin should wait before deleting
# the discord message that was sent.
delete_after_seconds: -1
Last updated