Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.70 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. import inspect
  4.  
  5. class Tutorials:
  6.     """
  7.    Commands for tutorials
  8.    """
  9.     def __init__(self, bot):
  10.         self.bot = bot
  11.         print('Addon "{}" loaded'.format(self.__class__.__name__))
  12.  
  13.     def isdiscordcommand(self, predicate):
  14.         if type(predicate) is commands.Command:
  15.             return True
  16.         else:
  17.             return False
  18.  
  19.     @commands.command()
  20.     async def test(self):
  21.         """test"""
  22.         #get commands from class
  23.         command_list = inspect.getmembers(Tutorials, predicate=self.isdiscordcommand)
  24.         #this is a tuple (name, reference)
  25.         for command in command_list:
  26.             name, ref = command
  27.             await self.bot.say("{}       {}".format(name,ref.help))
  28.  
  29.     @commands.command(aliases=["pkhex", "poke", "pkm"])
  30.     async def Pokemon_pkhex(self):
  31.         """Links to PKHeX tutorial"""
  32.         embed = discord.Embed(title="PKHeX tutorial", color=discord.Color.red())
  33.         embed.set_thumbnail(url="https://i.imgur.com/rr7Xf3E.jpg")
  34.         embed.url = "https://3ds.eiphax.tech/pkhex.html"
  35.         embed.description = "Basic tutorial for PKHeX"
  36.         await self.bot.say("", embed=embed)
  37.  
  38.     @commands.command(aliases=["acnl"])
  39.     async def Animal_crossing(self):
  40.         """Links to AC:NL editing tutorial"""
  41.         embed = discord.Embed(title="AC:NL editing tutorial", color=discord.Color.green())
  42.         embed.set_thumbnail(url="https://i.imgur.com/3rVToMF.png")
  43.         embed.url = "https://3ds.eiphax.tech/acnl.html"
  44.         embed.description = "Basic tutorial for AC:NL editing"
  45.         await self.bot.say("", embed=embed)
  46.  
  47. def setup(bot):
  48.     bot.add_cog(Tutorials(bot))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement