Discord Music bot VoiceClient’ object has no attribute ‘create_ytdl_player’

create_ytdl_player was the old way of creating a player. With discord.py@rewrite (> v.1.0), playing music is a bit more complicated. There are two ways to play music. For both ways, using FFmpeg will be necessary, so you’ll have to install it. Here are two of ways to play videos (with youtube-dl and ffmpeg): From file … Read more

on_message() and @bot.command issue

You have to place await bot.process_commands(message) outside of the if statement scope, process_command should be run regardless if the message startswith ”/lockdown”. @bot.event async def on_message(message): if message.content.startswith(‘/lockdown’): … await bot.process_commands(message) By the way, @commands.has_role(…) cannot be applied to on_message. Although there aren’t any errors (because there’s checking in place), has_role wouldn’t actually work as … Read more

Discord.py: on_member_join suddenly stopped working

discord.py 1.5.0 now supports discord API’s Privileged Gateway Intents. In order to be able to exploit server data, you need to: Enable Presence Intent and Server Members Intent in your discord application: Use discord.Intents at the beginning of your code: intents = Intents.all() #If you use commands.Bot() bot = commands.Bot(command_prefix=”!”, intents=intents) #If you use discord.Client() … Read more

“RuntimeWarning: coroutine ‘BotBase.load_extension’ was never awaited” after updating discord.py

Explanation As of discord.py version 2.0, Bot.load_extension is now a coroutine and has to be awaited. This is to allow Cog subclasses to override cog_unload with a coroutine. Code await must be used in front of client.load_extension, as shown: await client.load_extension(“your_extension”) In each of your cogs: Replace the standard setup function with an asynchronous one: … Read more