re-add limited selection of auto-responses

This commit is contained in:
Nexus 2024-02-21 01:26:20 +00:00
parent 2e613adaaa
commit 83a8c4ffa7
Signed by: nex
GPG key ID: 0FA334385D0B689F
5 changed files with 13 additions and 1 deletions

BIN
assets/boris.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

BIN
assets/carat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
assets/fedora.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
assets/lupupa.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -145,7 +145,6 @@ class Events(commands.Cog):
return
if message.channel.name == "femboy-hole":
def generate_payload(_message: discord.Message) -> MessagePayload:
_payload = MessagePayload(
message_id=_message.id,
@ -184,6 +183,19 @@ class Events(commands.Cog):
if message.channel.permissions_for(message.guild.me).manage_messages:
await message.delete(delay=1)
if message.content:
assets = Path.cwd() / "assets"
words = re.split(r"\s+", message.content)
words = set(map(str.lower, words))
if "lupupa" in words and (file := assets / "lupupa.jpg").exists():
await message.reply(file=discord.File(file), delete_after=60)
elif any(word in words for word in ("fedora", "nix", "nixos")) and (file := assets / "fedora.jpg").exists():
await message.reply(file=discord.File(file), delete_after=60)
elif "carat" in words and (file := assets / "carat.jpg").exists():
await message.reply(file=discord.File(file), delete_after=60)
elif "boris" in words and (file := assets / "boris.jpg").exists():
await message.reply(file=discord.File(file), delete_after=60)
@tasks.loop(minutes=10)
async def fetch_discord_atom_feed(self):
if not SPAM_CHANNEL: