-
Notifications
You must be signed in to change notification settings - Fork 0
/
doctor.py
31 lines (25 loc) · 922 Bytes
/
doctor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from discord.ext import commands
class Doctor(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.sleepers = set()
@commands.group()
async def doctor(self,ctx):
if ctx.invoked_subcommand is None:
ctx.send('zzzzzzz')
@doctor.command()
async def add(self, ctx):
for mention in ctx.message.mentions:
self.sleepers.add(mention)
await ctx.send(f'You were warned {mention.mention}')
@doctor.command()
async def remove(self, ctx):
message = ctx.message
for mention in message.mentions:
if message.author != mention:
self.sleepers.remove(mention)
@commands.Cog.listener()
async def on_message(self, message):
if message.author in self.sleepers:
await message.author.create_dm()
await message.author.dm_channel.send('GO SEE A DOCTOR!!')