mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Run black on all examples and require it for CI
This commit is contained in:
@ -22,11 +22,11 @@ ytdl_format_options = {
|
||||
'quiet': True,
|
||||
'no_warnings': True,
|
||||
'default_search': 'auto',
|
||||
'source_address': '0.0.0.0' # bind to ipv4 since ipv6 addresses cause issues sometimes
|
||||
'source_address': '0.0.0.0', # bind to ipv4 since ipv6 addresses cause issues sometimes
|
||||
}
|
||||
|
||||
ffmpeg_options = {
|
||||
'options': '-vn'
|
||||
'options': '-vn',
|
||||
}
|
||||
|
||||
ytdl = youtube_dl.YoutubeDL(ytdl_format_options)
|
||||
@ -125,21 +125,27 @@ class Music(commands.Cog):
|
||||
elif ctx.voice_client.is_playing():
|
||||
ctx.voice_client.stop()
|
||||
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
|
||||
bot = commands.Bot(command_prefix=commands.when_mentioned_or("!"),
|
||||
description='Relatively simple music bot example',
|
||||
intents=intents)
|
||||
bot = commands.Bot(
|
||||
command_prefix=commands.when_mentioned_or("!"),
|
||||
description='Relatively simple music bot example',
|
||||
intents=intents,
|
||||
)
|
||||
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
print(f'Logged in as {bot.user} (ID: {bot.user.id})')
|
||||
print('------')
|
||||
|
||||
|
||||
async def main():
|
||||
async with bot:
|
||||
await bot.add_cog(Music(bot))
|
||||
await bot.start('token')
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
|
Reference in New Issue
Block a user