Quoicoubeh
This commit is contained in:
parent
fcb2d4efe1
commit
e44066743d
11
main.py
11
main.py
|
@ -1,13 +1,13 @@
|
||||||
from typing import Optional, List
|
from typing import Optional, List
|
||||||
from os import getenv, listdir
|
from os import getenv, listdir
|
||||||
import discord
|
import re
|
||||||
|
|
||||||
|
import discord
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
from discord.app_commands import Choice
|
from discord.app_commands import Choice
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,12 +16,14 @@ class MyClient(commands.Bot):
|
||||||
intents = discord.Intents.none()
|
intents = discord.Intents.none()
|
||||||
intents.guilds = True
|
intents.guilds = True
|
||||||
intents.messages = True
|
intents.messages = True
|
||||||
|
intents.message_content = True
|
||||||
super().__init__(intents=intents, command_prefix=".")
|
super().__init__(intents=intents, command_prefix=".")
|
||||||
|
|
||||||
self.MY_GUILD = discord.Object(id=getenv("GUILD_ID"))
|
self.MY_GUILD = discord.Object(id=getenv("GUILD_ID"))
|
||||||
|
|
||||||
self.initial_extensions = ["cogs." + f[:-3] for f in listdir("./cogs") if
|
self.initial_extensions = ["cogs." + f[:-3] for f in listdir("./cogs") if
|
||||||
f.endswith(".py") and f.__str__() != "__init__.py"]
|
f.endswith(".py") and f.__str__() != "__init__.py"]
|
||||||
|
#self.add_listener(self.on_message)
|
||||||
|
|
||||||
async def setup_hook(self):
|
async def setup_hook(self):
|
||||||
# cogs
|
# cogs
|
||||||
|
@ -36,6 +38,11 @@ class MyClient(commands.Bot):
|
||||||
print(f"Discord version : {discord.__version__}")
|
print(f"Discord version : {discord.__version__}")
|
||||||
print('------')
|
print('------')
|
||||||
|
|
||||||
|
async def on_message(self, msg):
|
||||||
|
p = re.compile("[qQ]uoi[ \\.!?;]*$")
|
||||||
|
print(f"{msg!r}")
|
||||||
|
if p.search(msg.content) is not None:
|
||||||
|
await msg.reply("Quoicoubeh !")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
client = MyClient()
|
client = MyClient()
|
||||||
|
|
Loading…
Reference in New Issue