From d137ecf61baefd0c37c03ae921e41e86da7eab9f Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Tue, 30 Mar 2021 12:55:53 -0700 Subject: [PATCH] Adding command logging and updating help methodfs --- .gitignore | 1 + app/bot.py | 11 +++++++++++ app/help_methods.py | 3 ++- run_local.sh | 10 ++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 run_local.sh diff --git a/.gitignore b/.gitignore index 102086f3..e8120413 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dragon_bot_env *.pyc __pycache__ *.csv +*env diff --git a/app/bot.py b/app/bot.py index 712462fe..97a98903 100755 --- a/app/bot.py +++ b/app/bot.py @@ -429,4 +429,15 @@ async def cleanup(ctx): return await ctx.message.channel.purge(limit=num, check=is_discord_bot) + +@bot.event +async def on_command_completion(ctx): + channel = bot.get_channel(826547484632678453) + embed=discord.Embed(colour = discord.Color.green(), title = "Command Executed") + embed.add_field(name = "Command:", value = f"`{ctx.command}`") + embed.add_field(name = "User:", value = f"`{ctx.author}`", inline = False) + embed.add_field(name = "Channel:", value = f"{ctx.channel} **( <#{ctx.channel.id}> )**") + embed.add_field(name = "Server:", value = f"{ctx.guild} **( <#{ctx.channel.id}> )**") + await channel.send(embed=embed) + bot.run(TOKEN) diff --git a/app/help_methods.py b/app/help_methods.py index a52778cf..4097f898 100644 --- a/app/help_methods.py +++ b/app/help_methods.py @@ -178,9 +178,10 @@ def get_help_message(method): def get_help_embed(bot): categories = { - 'fun': ['ffxiv', 'clap', 'redpanda', 'birb', 'youtube', 'dog', 'excuse', 'greentext', 'lewd', 'message', 'meme', 'homepage', 'pout', 'roll', 'smug', 'quake', 'wink', 'verify'], + 'fun': ['ffxiv', 'clap', 'youtube', 'excuse', 'greentext', 'lewd', 'message', 'meme', 'homepage', 'pout', 'roll', 'smug', 'quake', 'wink', 'verify'], 'util': ['ask', 'corona', 'emoji', '8ball', 'decide', 'info', 'icon', 'wallpaper', 'stock', 'tts', 'issue'], 'users': ['help', 'invite', 'purge', 'roles', 'source'], + 'pictures of animals': ['birb', 'redpanda,' 'dale', 'dog', 'rat'], 'admin': ['cleanup'] } diff --git a/run_local.sh b/run_local.sh new file mode 100755 index 00000000..36b87434 --- /dev/null +++ b/run_local.sh @@ -0,0 +1,10 @@ +# Remove the running container so we cna re-use the container name 'dragon-bot' +printf "\n[-] Deleting old dragon-bot container from system\n" +docker rm -f dragon-bot +printf "[+] Done\n" + +# Run that shit and mount the docker socket so it can talk to the sky-factory container +printf "\n[-] Pulling latest build of container\n" +docker pull ldooks/dragon-bot:latest +docker run -d --name dragon-bot -v /Users/lrobles/Dropbox/dale:/tmp/dale --env-file /Users/lrobles/Dropbox/code/my_projects/docker-containers/dragon-bot/env --restart always ldooks/dragon-bot:latest +printf "[+] Done\n"