mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
🐛 fix(chat.py): add missing import statement for asyncio module
🐛 fix(chat.py): fix import statement for banusr module ✨ feat(chat.py): add functionality to ban and unban users with botator!ban and botator!unban commands ✨ feat(chat.py): add functionality to send messages from banned users after a delay ✨ feat(banusr.py): create banusr module to handle banning and unbanning of users ✨ feat(banusr.py): add functionality to ban a user by appending their ID to banend_users list ✨ feat(banusr.py): add functionality to unban a user by removing their ID from banend_users list
This commit is contained in:
@@ -4,9 +4,12 @@ from src.config import (
|
||||
debug,
|
||||
webhook_url,
|
||||
)
|
||||
import asyncio
|
||||
import src.makeprompt as mp
|
||||
import aiohttp
|
||||
|
||||
from src.utils import banusr
|
||||
|
||||
|
||||
class MyModal(discord.ui.Modal):
|
||||
def __init__(self, message):
|
||||
@@ -95,6 +98,21 @@ class Chat(discord.Cog):
|
||||
|
||||
@discord.Cog.listener()
|
||||
async def on_message(self, message: discord.Message):
|
||||
if await self.bot.is_owner(message.author):
|
||||
if message.content.startswith("botator!ban"):
|
||||
user2ban = message.content.split(" ")[1]
|
||||
await banusr.banuser(user2ban)
|
||||
await message.channel.send(f"User {user2ban} banned !")
|
||||
return
|
||||
if message.content.startswith("botator!unban"):
|
||||
user2ban = message.content.split(" ")[1]
|
||||
await banusr.unbanuser(user2ban)
|
||||
await message.channel.send(f"User {user2ban} unbanned !")
|
||||
return
|
||||
if str(message.author.id) in banusr.banend_users:
|
||||
await asyncio.sleep(2)
|
||||
await message.channel.send(message.content)
|
||||
return
|
||||
await mp.chat_process(self, message)
|
||||
|
||||
@discord.slash_command(name="say", description="Say a message")
|
||||
|
||||
Reference in New Issue
Block a user