mirror of
https://github.com/deadcxap/YandexMusicDiscordBot.git
synced 2026-01-11 20:51:39 +03:00
impr: Add player repeat and shuffle, play artist and playlist. Code optimization.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import os
|
||||
import logging
|
||||
from dotenv import load_dotenv
|
||||
|
||||
import discord
|
||||
from discord.errors import NotFound
|
||||
from discord.ext.commands import Bot
|
||||
|
||||
try:
|
||||
@@ -11,29 +11,33 @@ try:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
intents = discord.Intents.all()
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
bot = Bot(intents=intents)
|
||||
|
||||
cogs_list = [
|
||||
'general',
|
||||
'voice'
|
||||
]
|
||||
for cog in cogs_list:
|
||||
bot.load_extension(f'MusicBot.cogs.{cog}')
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
logging.info("Bot's ready!")
|
||||
|
||||
if __name__ == '__main__':
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
|
||||
if not os.path.exists('music'):
|
||||
os.mkdir('music')
|
||||
token = os.getenv('TOKEN')
|
||||
if not token:
|
||||
raise ValueError('You must specify the bot TOKEN in your enviroment')
|
||||
|
||||
for cog in cogs_list:
|
||||
bot.load_extension(f'MusicBot.cogs.{cog}')
|
||||
|
||||
logging.basicConfig(format='%(asctime)s:%(levelname)s:%(name)s: %(message)s')
|
||||
logging.getLogger('discord').setLevel(logging.INFO)
|
||||
|
||||
|
||||
bot.run(token)
|
||||
|
||||
Reference in New Issue
Block a user