Fix xkcd command

This commit is contained in:
eek7574 2022-11-16 17:28:47 +00:00
parent 5691cccd10
commit f58a17fedd
4 changed files with 13 additions and 4 deletions

View file

@ -99,7 +99,7 @@ class Events(commands.Cog):
if message.author.bot is True: if message.author.bot is True:
return return
if self.bot.user in message.mentions: if self.bot.user in message.mentions:
if message.content.lower() == "good bot": if message.content.startswith(self.bot.user.mention) and message.content.lower().endswith("good bot"):
return await message.reply("Thank you! :D") return await message.reply("Thank you! :D")

View file

@ -2,6 +2,7 @@ import discord
import aiohttp import aiohttp
import random import random
from discord.ext import commands from discord.ext import commands
from utils import console
class OtherCog(commands.Cog): class OtherCog(commands.Cog):
@ -65,6 +66,10 @@ class OtherCog(commands.Cog):
super().__init__(timeout=300, disable_on_timeout=True) super().__init__(timeout=300, disable_on_timeout=True)
self.n = n self.n = n
def __rich_repr__(self):
yield "n", self.n
yield "message", self.message
@discord.ui.button(label='Previous', style=discord.ButtonStyle.blurple) @discord.ui.button(label='Previous', style=discord.ButtonStyle.blurple)
async def previous_comic(self, _, interaction: discord.Interaction): async def previous_comic(self, _, interaction: discord.Interaction):
self.n -= 1 self.n -= 1

View file

@ -6,6 +6,8 @@ import discord
from discord.ext import commands, tasks from discord.ext import commands, tasks
import json import json
from pathlib import Path from pathlib import Path
import config
from utils import console, TimeTableDaySwitcherView from utils import console, TimeTableDaySwitcherView
from datetime import time, datetime, timedelta from datetime import time, datetime, timedelta
@ -183,6 +185,8 @@ class TimeTableCog(commands.Cog):
# @tasks.loop(time=schedule_times()) # @tasks.loop(time=schedule_times())
@tasks.loop(minutes=5) @tasks.loop(minutes=5)
async def update_status(self): async def update_status(self):
if config.dev:
return
console.log("[TimeTable Updater Task] Running!") console.log("[TimeTable Updater Task] Running!")
if not self.bot.is_ready(): if not self.bot.is_ready():
console.log("[TimeTable Updater Task] Bot is not ready, waiting until ready.") console.log("[TimeTable Updater Task] Bot is not ready, waiting until ready.")
@ -202,7 +206,7 @@ class TimeTableCog(commands.Cog):
message = _message message = _message
break break
else: else:
console.log(f"[TimeTable Updater Task] Sending new message in {channel.name!r}.", file=sys.stderr) console.log(f"[TimeTable Updater Task] Sending new message in {channel.name!r}.")
message = await channel.send("[tt] (loading)") message = await channel.send("[tt] (loading)")
message: discord.Message message: discord.Message

View file

@ -1,5 +1,5 @@
from rich.console import Console from rich import get_console
__all__ = ("console",) __all__ = ("console",)
console = Console() console = get_console()