async def on_raw_reaction_add(payload): #message_id #int – The message ID that got or lost a reaction. #user_id #int – The user ID who added or removed the reaction. #channel_id #int – The channel ID where the reaction got added or removed. #guild_id #Optional[int] – The guild ID where the reaction got added or removed, if applicable. #emoji #PartialEmoji – The custom or unicode emoji being used. msg = await bot.get_channel(payload.channel_id).get_message(payload.message_id) if payload.user_id != bot.user.id and msg.author == bot.user: emoji = payload.emoji.name ftext=msg.embeds[0].footer.text etitle = msg.embeds[0].author.name if ftext == 'Emoji-Converter': embed2 = discord.Embed(title="Reaction", description='```'+emoji+'```', color=0x00FF00) embed2.set_footer(text='Emoji-Converter') await msg.edit(embed=embed2) elif ftext == 'Unit': unit = FindBest(ToEmbed.DIRS['Unit'], etitle) await msg.edit(embed=ToEmbed.Unit(unit,PAGES['unit'][emoji])) elif ftext == 'Job': job = FindBest(ToEmbed.DIRS['Job'], etitle) await msg.edit(embed=ToEmbed.Job(job,PAGES['job'][emoji])) elif ftext == 'Item': item = FindBest(ToEmbed.DIRS['Item'], etitle) await msg.edit(embed=ToEmbed.Item(item,PAGES['item'][emoji]))
async def quest(ctx, *, name): quest = FindBest(ToEmbed.DIRS['Quests'], name,['name'],True) (embed,image)=ToEmbed.Quest(quest,'main') if image: await ctx.send(embed=embed,file=discord.File(image,filename='{}.png'.format(quest))) else: await ctx.send(embed=embed)
def main(): (command, name) = input('Input: ').split(' ', 1) if command == 'quest': quest = FindBest(ToEmbed.DIRS['Quests'], name, True) (embed, image) = ToEmbed.Quest(quest, 'main') print( json.dumps(embed.to_dict(), indent=4) ) #,file=discord.File(image,filename='{}.png'.format(quest)).to_dict(), if command == 'gear': gear = FindBest(ToEmbed.DIRS['Artifact'], name, True) embed = ToEmbed.Gear(gear, 'main') print(json.dumps(embed.to_dict(), indent=4)) if command == 'job': job = FindBest(ToEmbed.DIRS['Job'], name, True) embed = ToEmbed.Job(job, 'main') print(json.dumps(embed.to_dict(), indent=4)) if command == 'unit': unit = FindBest(ToEmbed.DIRS['Unit'], name, True) print(json.dumps(ToEmbed.Unit(unit, 'job2').to_dict(), indent=4)) if command == 'kaigan': unit = FindBest(ToEmbed.DIRS['Unit'], name, True) print(json.dumps(ToEmbed.Unit(unit, 'kaigan').to_dict(), indent=4)) if command == 'lore': unit = FindBest(ToEmbed.DIRS['Unit'], name, True) print(json.dumps(ToEmbed.Unit(unit, 'lore').to_dict(), indent=4)) if command == 'art': unit = FindBest(ToEmbed.DIRS['Unit'], name, True) for embed in ToEmbed.Unit(unit, 'art'): print(json.dumps(embed.to_dict(), indent=4)) if command == 'nensou': card = FindBest(ToEmbed.DIRS['Conceptcard'], name, True) print(json.dumps(ToEmbed.Conceptcard(card, 'main').to_dict(), indent=4)) main()
async def gear(ctx, *, name): gear = FindBest(ToEmbed.DIRS['Artifact'], name,['name'],True) msg = await ctx.send(embed= ToEmbed.Gear(gear, 'main')) await add_reactions(msg,PAGES['gear'])
async def job(ctx, *, name): job = FindBest(ToEmbed.DIRS['Job'], name,['name'],True) msg = await ctx.send(embed= ToEmbed.Job(job, 'main')) await add_reactions(msg,PAGES['job'])
async def nensou(ctx,*,name): card = FindBest(ToEmbed.DIRS['Conceptcard'], name,['name','unit','iname'], True) msg = await ctx.send(embed=ToEmbed.Conceptcard(card,'main')) await add_reactions(msg,PAGES['conceptcard'])
async def kaigan(ctx, *, name): unit = FindBest(ToEmbed.DIRS['Unit'], name,['name'], True) msg = await ctx.send(embed=ToEmbed.Unit(unit,'kaigan')) await add_reactions(msg,PAGES['unit'])
async def farm(ctx, *, name): item = FindBest(ToEmbed.DIRS['Item'], name,['name'], True) msg = await ctx.send(embed=ToEmbed.Item(item,'Story')) await add_reactions(msg,PAGES['item'])
async def art(ctx,*,name): unit = FindBest(ToEmbed.DIRS['Unit'], name,['name'], True) for embed in ToEmbed.Unit(unit,'art'): await ctx.send(embed=embed)