Mar-18-2018, 08:27 PM
For some reason once I added a music function to my discord bot it stopped working, can anyone tell me why? My code is;
# FangBot by SoulWolfX#1057 https://www.youtube.com/c/SoulWolfGamer for wolfnation startup_extensions = ["Music"] bot = commands.Bot(command_prefix='-') @bot.event async def on_ready(): print ("FangBot innitialized. hello wolfnation") class Main_Commands (): def __init__ (self, bot): self.bot = bot @client.event async def wait_until_login(): await client.change_presence(game=discord.Game(name='WolfNation bot made by http://bit.ly/2EzoA8e')) @bot.command(pass_context=True) async def ping(ctx): await bot.say(":ping_pong: Pong") print ("user has pinged") async def pong(ctx): await bot.say(":ping_pong: Ping") print ("user has ponged") @client.command(pass_context=True) async def yt(ctx): url = ctx.message.content url = url.strip('!yt ') author = ctx.message.author voice_channel = author.voice_channel vc = await client.join_voice_channel(voice_channel) player = await vc.create_ytdl_player(url) player.start() @bot.command(pass_context=True) async def info(ctx, user: discord.Member): await bot.say("The users name is (and no its not john cena): {}".format(user.name)) await bot.say("The users ID is: {}".format(user.id)) await bot.say("The users status is: {}".format(user.status)) await bot.say("The users rank is: {}".format(user.top_role)) await bot.say("The user joined at: {}".format(user.joined_at)) @bot.command(pass_context=True) async def kick(ctx, user: discord.Member): await bot.say(":boot: Cya, {}. don't wanna be ya.".format(user.name)) await bot.kick(user) @bot.command(pass_context=True) async def ban(ctx, user: discord.Member): await bot.say(":hammer: Dirty cheater {}. FACE THORS MIGHTY BAN HAMMER!".format(user.name)) await bot.ban(user) if __name__ == "__main__": for extension in startup_extension(extension) except Exception as e: exc = '{}: {}'.format(type(e).__name__, e) print('Failed to load extension {}\n{}'.format(extension, exc)) await client.change_presence(game=discord.Game(name="WolfNation bot made by http://bit.ly/2EzoA8e")) bot.run("PLACEHOlDER SO NO ONE STEALS MY BOT TOKEN")