From 8c97f7f774b4efa8424634d4d181ded1dd7511e4 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Tue, 1 Sep 2020 21:45:48 -0700 Subject: [PATCH] the final committ. Fixes #28 #27 #17 #14 #6 --- app/bot.py | 42 ++++++++++++++++++++++++++++++++++++++++++ app/gitlab.py | 3 --- app/help_methods.py | 7 +------ 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/app/bot.py b/app/bot.py index f9893fad..86ff3f3a 100755 --- a/app/bot.py +++ b/app/bot.py @@ -221,6 +221,23 @@ async def greentext(ctx): ) ) +@bot.command(name='wallpaper') +async def wallpaper(ctx): + import wallpaper + await ctx.send(embed=generate_embed(embed_url=wallpaper.get_wall(ctx.message.content))) + +@bot.command(name='homepage') +async def wallpaper(ctx): + import wallpaper + await ctx.send(embed=generate_embed(embed_url=wallpaper.fcking_homepage())) + + +@bot.command(name='clap') +async def clap(ctx): + + await ctx.send("{}".format(' :clap: '.join(ctx.message.content.split()[1:]))) + + @bot.command(name='birb') async def birb(ctx): import animals @@ -249,6 +266,31 @@ async def stock(ctx): await ctx.send(embed=result) +@bot.command(name='tts') +async def tts(ctx): + + import tts + if ctx.message.content.split()[1] == 'langs': + await ctx.send( + "Ok {}, check your DMs".format(ctx.message.author.mention) + ) + return await ctx.message.author.send(tts.get_all_langs()) + + await ctx.send( + file=discord.File( + tts.text_to_speech(ctx.message.content), + filename="A Message From {}.mp3".format(ctx.message.author.name) + ) + ) + await ctx.message.delete() + os.remove('/tmp/memes.mp3') + +@bot.command(name='issue') +async def issue(ctx): + + import gitlab + await ctx.send(gitlab.parse_message(ctx.message)) + @bot.command(name='source') async def source(ctx): diff --git a/app/gitlab.py b/app/gitlab.py index a755309f..bfb48cff 100644 --- a/app/gitlab.py +++ b/app/gitlab.py @@ -26,9 +26,6 @@ def create_issue(title, description): def parse_message(message): - if not role_check.is_admin(message.author.roles): - return 'You dont have permission to do that' - if len(message.content.split()) == 1: return help_methods.get_help_message(method='issue') diff --git a/app/help_methods.py b/app/help_methods.py index e3d10822..4ea2a238 100644 --- a/app/help_methods.py +++ b/app/help_methods.py @@ -51,11 +51,6 @@ def get_help_message(method): 'Returns a definiton of a word from urban dictionary', '\nUsage: !define loli' ], - 'minecraft': [ - 'Allows you to interact with the minecraft server.', - 'You can do things like !minecraft logs, or !minecraft map', - ' or !minecraft status to get information about the server' - ], 'dog': [ 'Returns the URL to a G O O D B O Y E or G I R L', '\nUsage: !dog' @@ -172,7 +167,7 @@ def get_help_embed(bot): categories = { 'fun': ['ffxiv', 'clap', 'redpanda', 'birb', 'youtube', 'dog', 'excuse', 'greentext', 'lewd', 'message', 'meme', 'homepage', 'pout', 'roll', 'smug', 'quake', 'wink',], 'util': ['corona', '8ball', 'decide', 'info', 'icon', 'wallpaper', 'stock', 'tts', 'issue'], - 'users': ['help', 'invite', 'purge', 'roles', 'source', 'minecraft'], + 'users': ['help', 'invite', 'purge', 'roles', 'source'], 'admin': ['emoji', 'cleanup'] }