I'm using cogs to shorten and organise my discord bot. However upon attempting a "Events" cog I'm faced with a NameError of changePlaying not being defined despite it literally being about the on_ready command
A: I forgot to import discord.ext and hence imported that. B: I've tried changing the location of the list of possible statuses in and out of the changePlaying event
PlayingList = [Maximus.py.","!help"]
async def changePlaying(self):
while True:
await self.bot.change_presence(game=Game(name=random.choice(PlayingList)))
await asyncio.sleep(120)
async def on_ready(self):
print('Logged in as')
print(self.bot.user.name)
print(self.bot.user.id)
print('-----------------------------------------')
print('Log in complete')
for x in range(5):
print("")
self.bot.loop.create_task(changePlaying(self))
Well I think it's clear what the expected results are but to clarify the bot is supposed to boot. It does come online and does listen to commands but the status bar does not change