forked from viveksantayana/geas-bot
Added config checking, event listeners, etc.
Can track added features by comparing TODO list.
This commit is contained in:
23
app/cogs/membership_restriction/message_listener.py
Normal file
23
app/cogs/membership_restriction/message_listener.py
Normal file
@ -0,0 +1,23 @@
|
||||
import os # OS Locations
|
||||
import yaml # YAML parser for Bot config files
|
||||
import asyncio # Discord Py Dependency
|
||||
import discord # Main Lib
|
||||
from discord.ext import commands # Commands module
|
||||
from discord_slash import SlashCommand, SlashContext, cog_ext, utils # Slash Command Library
|
||||
from discord_slash.utils.manage_commands import create_choice, create_option # Slash Command features
|
||||
import logging
|
||||
# logger and handler
|
||||
from bot import configFile, yaml_load
|
||||
|
||||
##### Membership Restriction Message Listener Cog
|
||||
class RestrictionMessageListener(commands.Cog, name='Membership Restriction Message Listener'):
|
||||
def __init__(self, client):
|
||||
self.client = client
|
||||
|
||||
@commands.Cog.listener()
|
||||
async def on_message(self,message):
|
||||
if message.author.bot:
|
||||
return
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(RestrictionMessageListener(client))
|
Reference in New Issue
Block a user