Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

What worng on this discord music bot code

$
0
0

I just copy this code from youtube

import discordfrom discord.ext import commandsimport os, asyncio#import all of the cogsfrom help_cog import help_cogfrom music_cog import music_cogintents = discord.Intents.all()bot = commands.Bot(command_prefix='/', intents=intents)bot.remove_command('help')#remove the default help command so that we can write out ownasync def main():    async with bot:        await bot.add_cog(help_cog(bot))        await bot.add_cog(music_cog(bot))        await bot.start(os.getenv['TOKEN'])asyncio.run(main())

Here is the error

> await bot.start(os.getenv['TOKEN'])> TypeError: 'function' object is not subscriptable

I think i download all the function.That need for thisCan anyone help me fix this error


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>