mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2024-12-23 07:05:32 +00:00
cron: Wait until bot is ready
This commit is contained in:
parent
3418c206d9
commit
7f7a4c4707
|
@ -22,6 +22,7 @@ class Robocronp(Cog):
|
||||||
self.daily.cancel()
|
self.daily.cancel()
|
||||||
|
|
||||||
async def send_data(self):
|
async def send_data(self):
|
||||||
|
await self.bot.wait_until_ready()
|
||||||
data_files = [discord.File(fpath) for fpath in self.bot.wanted_jsons]
|
data_files = [discord.File(fpath) for fpath in self.bot.wanted_jsons]
|
||||||
log_channel = self.bot.get_channel(config.botlog_channel)
|
log_channel = self.bot.get_channel(config.botlog_channel)
|
||||||
await log_channel.send("Hourly data backups:", files=data_files)
|
await log_channel.send("Hourly data backups:", files=data_files)
|
||||||
|
@ -60,6 +61,7 @@ class Robocronp(Cog):
|
||||||
await ctx.send(f"{ctx.author.mention}: Deleted!")
|
await ctx.send(f"{ctx.author.mention}: Deleted!")
|
||||||
|
|
||||||
async def do_jobs(self, ctab, jobtype, timestamp):
|
async def do_jobs(self, ctab, jobtype, timestamp):
|
||||||
|
await self.bot.wait_until_ready()
|
||||||
log_channel = self.bot.get_channel(config.botlog_channel)
|
log_channel = self.bot.get_channel(config.botlog_channel)
|
||||||
for job_name in ctab[jobtype][timestamp]:
|
for job_name in ctab[jobtype][timestamp]:
|
||||||
try:
|
try:
|
||||||
|
@ -98,6 +100,7 @@ class Robocronp(Cog):
|
||||||
)
|
)
|
||||||
|
|
||||||
async def clean_channel(self, channel_id):
|
async def clean_channel(self, channel_id):
|
||||||
|
await self.bot.wait_until_ready()
|
||||||
log_channel = self.bot.get_channel(config.botlog_channel)
|
log_channel = self.bot.get_channel(config.botlog_channel)
|
||||||
channel = self.bot.get_channel(channel_id)
|
channel = self.bot.get_channel(channel_id)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue