Advertisement
dragonforce3

help.py

Jul 23rd, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. import discord
  2. import traceback
  3. import psutil
  4. import os
  5. import asyncio
  6.  
  7. from discord.ext import commands
  8. from utils import default
  9.  
  10. class Help:
  11.  
  12. def __init__(self, bot):
  13. self.bot = bot
  14. self.config = default.get("config.json")
  15.  
  16. @commands.group(pass_context=True, name='help', aliases=['cmds', 'h'])
  17. async def _help(self, ctx):
  18. """ Class for help commands. """
  19.  
  20. if ctx.invoked_subcommand is None:
  21. embed = discord.Embed(colour=ctx.me.top_role.colour)
  22. embed.set_thumbnail(url=ctx.bot.user.avatar_url)
  23. embed.add_field(name="Moderation", value=".help Moderation", inline=False)
  24. embed.add_field(name="Developer Functions", value=".help Developer", inline=False)
  25. embed.add_field(name="Entertainment", value=".help Fun", inline=False)
  26. embed.add_field(name="Event Management", value=".help Event", inline=False)
  27. embed.add_field(name="Utility", value=".help Utility", inline=False)
  28. embed.add_field(name="Music", value=".help Music", inline=False)
  29.  
  30. await ctx.send(content=f"Please, choose a help category.", embed=embed)
  31.  
  32. @_help.command(pass_context=True, name='Moderation', aliases=['mod', 'Mod', 'moderation'])
  33. async def _mod(self, ctx):
  34. """ Moderation Commands """
  35.  
  36. embed = discord.Embed(colour=ctx.me.top_role.colour)
  37. embed.set_thumbnail(url=ctx.bot.user.avatar_url)
  38. embed.add_field(name=".ban <user.id> [reason]", value="Bans an user from the server.", inline=False)
  39. embed.add_field(name=".find <query>", value="Finds an user through search query.", inline=False)
  40. embed.add_field(name=".kick <user.id> [reason]", value="Kicks an user from the server.", inline=False)
  41. embed.add_field(name=".massban [reason] <user.mentions>", value="Bans multiple users at once with the same reason.", inline=False)
  42. embed.add_field(name=".mute <user.id> [reason]", value="Gives **Muted** role to an user.", inline=False)
  43. embed.add_field(name=".nickname <user.id> [nickname]", value="Changes the nickname of a certain user.", inline=False)
  44. embed.add_field(name=".prune", value="Cleans messages in a certain channel.", inline=False)
  45. embed.add_field(name=".unban <user.id> [reason]", value="Unbans an user from the server.", inline=False)
  46. embed.add_field(name=".unmute <user.id> [reason]", value="Removes the **Muted** role from a certain user.")
  47.  
  48. await ctx.send(embed=embed)
  49.  
  50.  
  51. def setup(bot):
  52. bot.remove_command('help')
  53. bot.add_cog(Help(bot))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement