Adding command logging and updating help methodfs

This commit is contained in:
Luke Robles 2021-03-30 12:55:53 -07:00 committed by ein
parent 0d563a7e6f
commit d137ecf61b
4 changed files with 24 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ dragon_bot_env
*.pyc
__pycache__
*.csv
*env

View File

@ -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)

View File

@ -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']
}

10
run_local.sh Executable file
View File

@ -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"