fix initial async errors

This commit is contained in:
2022-10-25 19:39:02 +02:00
parent 35d5d45833
commit 336c3f7655
2 changed files with 13 additions and 14 deletions
+1
View File
@@ -15,6 +15,7 @@ class Points(commands.Cog):
self.voice_states = {}
self.BANK_ID = 42
self.init()
def __check(self, ctx):
return True
+12 -14
View File
@@ -15,7 +15,15 @@ from discord.ext import commands
logging.basicConfig(level=logging.INFO)
bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'), description='Stroopwafel. Shitpost bot extraordinaire.', pm_help=True)
async def add_cogs(bot):
await bot.add_cog(Shitpost.Shitpost(bot))
await bot.add_cog(General.General(bot))
await bot.add_cog(Cryptocoin.Cryptocoin(bot))
await bot.add_cog(Chatbot.Chatbot(bot))
await bot.add_cog(Points.Points(bot))
bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'), description='Stroopwafel. Shitpost bot extraordinaire.', pm_help=True, intents=discord.Intents.default())
#Read configuration file:
config = configparser.ConfigParser()
@@ -24,6 +32,7 @@ bot.tokens = config["tokens"]
bot.hdChannels = {}
for channel in config["channels"]: #channelIDs must be integers
bot.hdChannels[channel] = int(config["channels"][channel])
#passwords are base64 encoded, which makes it like 1% safer
bot.passwords = {}
for pw in config["passwords"]:
@@ -33,20 +42,9 @@ for pw in config["passwords"]:
print("Problem with decoding password!")
bot.passwords[pw] = config["passwords"][pw]
#bot.add_cog(Music.Music(bot))
#TODO: Re-add music functions now that we require a stronger host
bot.add_cog(Shitpost.Shitpost(bot))
bot.add_cog(General.General(bot))
bot.add_cog(Cryptocoin.Cryptocoin(bot))
bot.add_cog(Chatbot.Chatbot(bot))
pointsBot = Points.Points(bot)
bot.add_cog(pointsBot)
@bot.event
@asyncio.coroutine
def on_ready():
async def on_ready():
await add_cogs(bot)
print('Logged in as:\n{0} (ID: {0.id})'.format(bot.user))
#TODO: find out how to do this properly:
pointsBot.init()
bot.run(bot.tokens["discordbot"])