add invite command

This commit is contained in:
bmintz 2018-07-31 18:02:44 -05:00
parent c5c6e7ef24
commit f44b106b60
2 changed files with 29 additions and 0 deletions

28
cogs/meta.py Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python3
# encoding: utf-8
import discord
from discord.ext import commands
class Meta:
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=['inv'])
async def invite(self, context):
"""Gives you a link to add me to your server."""
permissions = discord.Permissions()
permissions.update(**dict.fromkeys((
'read_messages',
'send_messages',
'add_reactions',
'external_emojis',
'manage_emojis',
'embed_links',
), True))
await context.send('<%s>' % discord.utils.oauth_url(self.bot.user.id, permissions))
def setup(bot):
bot.add_cog(Meta(bot))

View File

@ -1,6 +1,7 @@
{
'cogs': (
'cogs.emote',
'cogs.meta',
'ben_cogs.debug',
'ben_cogs.misc',
'ben_cogs.debug'