
The latest and most up-to-date stable discord.py version can be installed using pip install -U discord.py.īefore migrating to discord.py 2.0, make sure you read the migration guide here as there are lots of breaking changes. Make sure that the version is 2.0 or above!Īlso, make sure to uninstall any third party libraries intended to add slash-command support to pre-2.0 discord.py, as they are no longer necessary and will likely cause issues. Install the latest version of discord.py ¶īefore you can make use of any of the new 2.0 features, you need to install the latest version of discord.py. Original discord.py Gist regarding resumption can be found here. Additions to the library include support for Buttons, Select Menus, Forms (AKA Modals), Slash Commands (AKA Application Commands) and a bunch more handy features! All the changes can be found here. Upon the return of the most popular discord API wrapper library for Python, discord.py, while catching on to the latest features of the discord API, there have been numerous changes with additions of features to the library. Bot ( command_prefix = "!" ) # Executes when the bot is ready async def on_ready (): print ( f '' ) bot.

getenv ( "DISCORD_TOKEN" ) minecraft_server_url = "lightmc.fun" # this is just an example, and you should use your own minecraft server bot_help_message = """ :: Bot Usage :: `!mc help` : shows help `!mc serverusage` : shows system load in percentage `!mc serverstatus` : shows if the server is online or offline `!mc whoisonline` : shows who is online at the moment """ available_commands = # Set the bot command prefix bot = commands.


Import discord from discord.ext import commands import requests import os from dotenv import load_dotenv import random import multiprocessing # Variables BOT_NAME = "MinecraftBot" load_dotenv () DISCORD_TOKEN = os.
