Adding maintainer to settings, complete suggest

This commit is contained in:
Akumatic
2018-06-20 23:39:16 +02:00
parent c0bc979330
commit bd048acc95
4 changed files with 85 additions and 15 deletions

View File

@ -16,21 +16,28 @@ class User():
await ctx.send("""Invite Link: <https://discordapp.com/oauth2/authorize?client_id={}&scope=bot&permissions=8>
\nPlease read <https://github.com/Akumatic/Akuma-Matata/blob/master/README.md> for informations""".format(self.bot.user.id))
@commands.command()
async def suggest(self, ctx, *, msg : str):
async def suggest(self, ctx, *, msg : str = None):
"""Makes a suggestion to the moderation team.
Planned: If there's no suggestionChannel specified, send a pm to the owner."""
Only callable from a server
Your original message gets deleted and sent to a private suggestion channel.
If no suggestion channel is specified, it will be sent to the owner instead."""
if(ctx.guild == None):
return await ctx.send("This command can only be used within a server")
if(msg == None):
return await ctx.send("Your suggestion can't be empty")
await ctx.message.delete()
e = discord.Embed(color=0x6428c8)
e = discord.Embed(description="Server: " + ctx.guild.name, color=0x6428c8)
e.set_author(name=ctx.author, icon_url=ctx.author.avatar_url)
e.add_field(name="Suggestion", value=msg)
if(s[str(ctx.guild.id)]["suggestionChannel"] != 0):
chan = self.bot.get_channel(s[str(ctx.guild.id)]["suggestionChannel"])
await chan.send(embed=e)
else:
await ctx.send(e)
await ctx.guild.get_member(ctx.guild.owner.id).send(embed=e)
#Setup
def setup(bot):