feat: Add misandrist insults and big CS2 events matches fetch from HLTV.org

This commit is contained in:
2026-07-04 22:36:07 +02:00
parent 2cf7cc94bb
commit 80d34e9660
13 changed files with 692 additions and 716 deletions

31
cogs/insult.py Normal file
View File

@@ -0,0 +1,31 @@
import discord, json, os, random, re
import collections
from discord.ext import commands
from setup.logger import LOGGER
class InsultsCog(commands.Cog):
def __init__(self, bot:discord.Bot):
self.bot = bot
with open(os.path.join("data", "insults.txt")) as f:
self.insults = [l.strip() for l in f.readlines()]
@commands.Cog.listener()
async def on_message(self, message:discord.Message):
if len(message.content.split()) > 3:
author = message.author
if any(author.id == u.id for u in self.men):
r = int(random.random()*100)
print(r)
if r < 5:
insult = random.choice(self.insults)
await message.reply(insult)
@commands.Cog.listener()
async def on_ready(self):
self.men:list[discord.Member] = []
for guild in self.bot.guilds:
for role in guild.roles:
if re.match(r'^([hH]im|[hH]e).*$',role.name):
self.men.extend(role.members)
self.men = list(set(self.men))