Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- import inspect
- class Tutorials:
- """
- Commands for tutorials
- """
- def __init__(self, bot):
- self.bot = bot
- print('Addon "{}" loaded'.format(self.__class__.__name__))
- def isdiscordcommand(self, predicate):
- if type(predicate) is commands.Command:
- return True
- else:
- return False
- @commands.command()
- async def test(self):
- """test"""
- #get commands from class
- command_list = inspect.getmembers(Tutorials, predicate=self.isdiscordcommand)
- #this is a tuple (name, reference)
- for command in command_list:
- name, ref = command
- await self.bot.say("{} {}".format(name,ref.help))
- @commands.command(aliases=["pkhex", "poke", "pkm"])
- async def Pokemon_pkhex(self):
- """Links to PKHeX tutorial"""
- embed = discord.Embed(title="PKHeX tutorial", color=discord.Color.red())
- embed.set_thumbnail(url="https://i.imgur.com/rr7Xf3E.jpg")
- embed.url = "https://3ds.eiphax.tech/pkhex.html"
- embed.description = "Basic tutorial for PKHeX"
- await self.bot.say("", embed=embed)
- @commands.command(aliases=["acnl"])
- async def Animal_crossing(self):
- """Links to AC:NL editing tutorial"""
- embed = discord.Embed(title="AC:NL editing tutorial", color=discord.Color.green())
- embed.set_thumbnail(url="https://i.imgur.com/3rVToMF.png")
- embed.url = "https://3ds.eiphax.tech/acnl.html"
- embed.description = "Basic tutorial for AC:NL editing"
- await self.bot.say("", embed=embed)
- def setup(bot):
- bot.add_cog(Tutorials(bot))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement