-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmembers.py
28 lines (22 loc) · 844 Bytes
/
members.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
import discord
from discord.ext import commands
class Members():
def __init__(self, bot):
self.bot = bot
@commands.command()
async def joined(self, member : discord.Member):
"""Says when a member joined."""
await self.bot.say('{0.name} joined in {0.joined_at}'.format(member))
@commands.group(pass_context=True)
async def cool(self, ctx):
"""Says if a user is cool.
In reality this just checks if a subcommand is being invoked.
"""
if ctx.invoked_subcommand is None:
await self.bot.say('No, {0.subcommand_passed} is not cool'.format(ctx))
@cool.command(name='bot')
async def _bot(self):
"""Is the bot cool?"""
await self.bot.say('Yes, the bot is cool.')
def setup(bot):
bot.add_cog(Members(bot))