async def add_guild(self, guild, data): _data = guild_data_structure _data['_id'] = create_id() _data['guild_id'] = guild.id _data['log_config']['log'] = data.get("log", False) _data['log_config']['log_channel_id'] = data.get( "log_channel_id", None) _data['ia_config']["auto_msg"] = data.get("auto_msg", False) _data['bot_config']["ash_news"] = data.get("ash_news", False) _data['bot_config']["ash_news_id"] = data.get("ash_news_id", None) _data['bot_config']["ash_git"] = data.get("ash_git", False) _data['bot_config']["ash_git_id"] = data.get("ash_git_id", None) _data['bot_config']["ash_draw"] = data.get("ash_draw", False) _data['bot_config']["ash_draw_id"] = data.get("ash_draw_id", None) _data['func_config']["cont_users"] = data.get("cont_users", False) _data['func_config']["cont_users_id"] = data.get("cont_users_id", None) _data['func_config']["member_join"] = data.get("member_join", False) _data['func_config']["member_join_id"] = data.get( "member_join_id", None) _data['func_config']["member_remove"] = data.get( "member_remove", False) _data['func_config']["member_remove_id"] = data.get( "member_remove_id", None) if await self.get_data("guild_id", guild.id, "guilds") is None: await self.push_data(_data, "guilds")
async def add_user(self, ctx): if await self.get_data("user_id", ctx.author.id, "users") is None: _data = user_data_structure _data["_id"] = create_id() _data["user_id"] = ctx.author.id _data["guild_id"] = ctx.guild.id await self.push_data(_data, "users")
async def add_user(self, ctx): # atualizado no banco de dados if await self.get_data("user_id", ctx.author.id, "users") is None: _data = user_data_structure _data["_id"] = create_id() _data["user_id"] = ctx.author.id _data["guild_id"] = ctx.guild.id _data["config"]["create_at"] = datetime.datetime.today() await self.push_data(_data, "users")
async def mercadd(self, ctx, value: int = None, amount: int = None, *, item=None): """Comando para adicionar loja no mercado""" global item_key_equip, item_key_craft, _type if value is None: return await ctx.send( "<:alert:739251822920728708>│`Você precisa dizer o preço da unidade!`" ) if value < 1: return await ctx.send( "<:alert:739251822920728708>│`Você precisa dizer uma quantia maior que 0.`" ) if amount is None: return await ctx.send( "<:alert:739251822920728708>│`Você precisa dizer uma quantidade de itens!`" ) if amount < 1: return await ctx.send( "<:alert:739251822920728708>│`Você precisa dizer uma quantia maior que 0.`" ) if item is None: return await ctx.send( "<:alert:739251822920728708>│`Você esqueceu de falar o nome do item para colocar " "na loja!`") item_key_equip, item_key_craft, _type, count = None, None, None, 0 data = await self.bot.db.get_all_data("merchant") data_user = await self.bot.db.get_data("user_id", ctx.author.id, "users") if len(data) > 0: for key in data: if key['owner'] == ctx.author.id: count += 1 TOT = _MAX_VIP if data_user['config']['vip'] else _MAX if count > TOT: return await ctx.send( "<:alert:739251822920728708>│`Você atingiu a quantidade maxima de lojas disponiveis" " por usuario, voce pode esperar as lojas esvaziarem por compras ou pode " "editar/remover a loja do mercado.`") item_key_craft = convert_item_name(item, self.bot.items) if item_key_craft is not None: _type = "craft" if self.bot.items[item_key_craft][2] is False: if self.bot.items[item_key_craft][3] == 8 or self.bot.items[ item_key_craft][3] == 12: return await ctx.send( "<:alert:739251822920728708>│`Você não pode vender esse tipo de item.`" ) equips_list = list() for ky in self.bot.config['equips'].keys(): for k, v in self.bot.config['equips'][ky].items(): equips_list.append((k, v)) if item not in [i[1]["name"] for i in equips_list]: if "sealed" in item.lower() and item.lower() != "unsealed stone": return await ctx.send( "<:negate:721581573396496464>│`ESSE ITEM ESTÁ SELADO, ANTES DISSO TIRE O SELO " "USANDO O COMANDO:` **ASH LIBERAR**") if _type is None: return await ctx.send( "<:negate:721581573396496464>│`ESSE ITEM NAO É NEM UM CRAFT NEM UM EQUIPAMENTO " "VALIDO, VERIFIQUE O NOME DO ITEM E TENTE NOVAMENTE...`") if item in [i[1]["name"] for i in equips_list] and _type is None: _type = "equip" data = await self.bot.db.get_data("user_id", ctx.author.id, "users") update = data if ctx.author.id in self.bot.jogando: return await ctx.send( "<:alert:739251822920728708>│`Você está jogando, aguarde para quando" " vocÊ estiver livre!`") if not update['rpg']['active']: embed = discord.Embed( color=self.bot.color, description= '<:negate:721581573396496464>│`USE O COMANDO` **ASH RPG** `ANTES!`' ) return await ctx.send(embed=embed) if ctx.author.id in self.bot.batalhando: msg = '<:negate:721581573396496464>│`VOCE ESTÁ BATALHANDO!`' embed = discord.Embed(color=self.bot.color, description=msg) return await ctx.send(embed=embed) if _type == "craft": item_name = self.bot.items[item_key_craft][1] if item_key_craft not in update['inventory']: return await ctx.send( "<:alert:739251822920728708>│`Você não tem esse item no seu inventario!`" ) if update['inventory'][item_key_craft] < amount: return await ctx.send( f"<:alert:739251822920728708>│`VOCÊ NÃO TEM ESSA QUANTIDADE DISPONIVEL DE " f"{item_name.upper()}!`") update['inventory'][item_key_craft] -= amount if update['inventory'][item_key_craft] < 1: del update['inventory'][item_key_craft] item_key_equip = None if _type == "equip": for key in update['rpg']['items'].keys(): for name in equips_list: if name[0] == key and name[1]["name"] == item: item_key_equip = name if item_key_equip is None: return await ctx.send( "<:negate:721581573396496464>│`VOCE NAO TEM ESSE ITEM...`") if update['rpg']['items'][item_key_equip[0]] < amount: return await ctx.send( f"<:alert:739251822920728708>│`VOCÊ NÃO TEM ESSA QUANTIDADE DISPONIVEL DE " f"{item_key_equip[1]['name'].upper()}!`") update['rpg']['items'][item_key_equip[0]] -= amount if update['rpg']['items'][item_key_equip[0]] < 1: del update['rpg']['items'][item_key_equip[0]] if _type == "craft": item_merchant = item_key_craft else: item_merchant = item_key_equip[0] _id = create_id() a = '{:,.2f}'.format(float(value)) b = a.replace(',', 'v') c = b.replace('.', ',') d = c.replace('v', '.') data_merchant = { "_id": _id, "owner": ctx.author.id, "type": _type, "amount": amount, "item": item_merchant, "value": value } await self.bot.db.push_data(data_merchant, "merchant") await self.bot.db.update_data(data, update, 'users') await ctx.send( f'<:confirmed:721581574461587496>│`PARABENS, VC ACABOU DE CRIAR UMA LOJA` **{_id}** ' f'`NO MERCADO, CONTENDO` **{amount}** `DE` **{item.upper()}** `CUSTANDO` **R$ {d}** ' f'`A UNIDADE COM SUCESSO!`') await self.bot.data.add_sts(ctx.author, "merchant_add", 1)
async def skill(self, ctx): """Comando usado pra ver seus status no rpg da Ashley Use ash skill""" if ctx.invoked_subcommand is None: try: member = ctx.message.mentions[0] except IndexError: member = ctx.author try: if self.he[ctx.author.id]: if str(ctx.command) in self.he[ctx.author.id].keys(): pass else: self.he[ctx.author.id][str(ctx.command)] = False except KeyError: self.he[ctx.author.id] = {str(ctx.command): False} data = await self.bot.db.get_data("user_id", member.id, "users") if not data['rpg']['active']: embed = discord.Embed( color=self.bot.color, description='<:negate:721581573396496464>│``USE O COMANDO`` **ASH RPG** ``ANTES!``') return await ctx.send(embed=embed) db = { "name": member.name, "avatar_member": member.avatar_url_as(format="png"), "vip": data['rpg']['vip'], "xp": data['rpg']['xp'], "level": str(data['rpg']['level']), "class": str(data['rpg']['next_class']), "atk": str(data['rpg']['status']['atk']), "dex": str(data['rpg']['status']['agi']), "acc": str(data['rpg']['status']['prec']), "con": str(data['rpg']['status']['con']), "luk": str(data['rpg']['status']['luk']), "pdh": str(data['rpg']['status']['pdh']) } await skill_points(db) if discord.File('skill_points.png') is None: return await ctx.send("<:negate:721581573396496464>│``ERRO!``") _id = create_id() self.botmsg[_id] = await ctx.send(file=discord.File('skill_points.png')) if not self.he[ctx.author.id][str(ctx.command)]: await self.botmsg[_id].add_reaction('<a:help:767825933892583444>') await self.botmsg[_id].add_reaction(self.bot.config['emojis']['arrow'][4]) text = "``--==ENTENDA O QUE OS ATRIBUTOS ALTERAM NO SEU PERSONAGEM==--``\n" \ ">>> >>> `ATK` - **O ATK é somado ao seu dano de Skill e ao dano critico**\n" \ ">>> `DEX` - **O DEX aumenta sua chance de esquiva.**\n" \ ">>> `ACC` - **O ACC aumenta sua chance de acerto da Skill.**\n" \ ">>> `CON` - **O CON aumenta seu HP e sua MANA total.**\n" \ ">>> `LUK` - **LUK aumenta a chance de efeito da Skill e a chance de critico.**\n" \ "```Markdown\n[>>]: PARA ADICIONAR PONTOS DE HABILIDADE USE" \ " O COMANDO\n<ASH SKILL ADD>\n[>>]: PARA RESETAR OS PONTOS DE " \ "HABILIDADE USE O COMANDO\n<ASH SKILL RESET>```" again = False msg = None if not self.he[ctx.author.id][str(ctx.command)]: self.he[ctx.author.id][str(ctx.command)] = True while not self.bot.is_closed(): try: reaction = await self.bot.wait_for('reaction_add', timeout=30.0) while reaction[1].id != ctx.author.id: reaction = await self.bot.wait_for('reaction_add', timeout=30.0) emo = "<a:help:767825933892583444>" emoji = str(emo).replace('<a:', '').replace(emo[emo.rfind(':'):], '') emo_2 = self.bot.config['emojis']['arrow'][4] emoji_2 = str(emo_2).replace('<:', '').replace(emo_2[emo_2.rfind(':'):], '') try: try: _reaction = reaction[0].emoji.name except AttributeError: _reaction = reaction[0].emoji if _reaction == emoji and reaction[0].message.id == self.botmsg[_id].id and not again: if reaction[1].id == ctx.author.id: again = True try: await self.botmsg[_id].remove_reaction("<a:help:767825933892583444>", ctx.author) except discord.errors.Forbidden: pass msg = await ctx.send(text) elif _reaction == emoji and reaction[0].message.id == self.botmsg[_id].id and again: if reaction[1].id == ctx.author.id: again = False try: await self.botmsg[_id].remove_reaction("<a:help:767825933892583444>", ctx.author) except discord.errors.Forbidden: pass await msg.delete() if _reaction == emoji_2 and reaction[0].message.id == self.botmsg[_id].id: if reaction[1].id == ctx.author.id: self.he[ctx.author.id][str(ctx.command)] = False await self.botmsg[_id].remove_reaction( self.bot.config['emojis']['arrow'][4], ctx.me) await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.me) return except AttributeError: pass except TimeoutError: self.he[ctx.author.id][str(ctx.command)] = False await self.botmsg[_id].remove_reaction(self.bot.config['emojis']['arrow'][4], ctx.me) await self.botmsg[_id].remove_reaction("<a:help:767825933892583444>", ctx.me) return
async def enchant(self, ctx): """Comando usado pra ver os encatamentos das suas habilidades no rpg da Ashley Use ash enchant""" if ctx.invoked_subcommand is None: try: member = ctx.message.mentions[0] except IndexError: member = ctx.author try: if self.he[ctx.author.id]: if str(ctx.command) in self.he[ctx.author.id].keys(): pass else: self.he[ctx.author.id][str(ctx.command)] = False except KeyError: self.he[ctx.author.id] = {str(ctx.command): False} data = await self.bot.db.get_data("user_id", member.id, "users") if not data['rpg']['active']: embed = discord.Embed( color=self.bot.color, description= '<:negate:721581573396496464>│``USE O COMANDO`` **ASH RPG** ``ANTES!``' ) return await ctx.send(embed=embed) self.atacks = {} data_player = self.config_player(member, data['rpg'], data['rpg']['lower_net']) rate = [ _class[data_player['class']]['rate']['life'], _class[data_player['class']]['rate']['mana'] ] if data_player['level'] > 25: rate[0] += _class[data_player['next_class']]['rate']['life'] rate[1] += _class[data_player['next_class']]['rate']['mana'] data_player['status'][ 'hp'] = data_player['status']['con'] * rate[0] data_player['status'][ 'mp'] = data_player['status']['con'] * rate[1] self.db = data_player for c in range(5): if self.db['level'] >= levels[c]: self.atacks[_class[self.db['next_class']][str( c)]['name']] = _class[self.db['next_class']][str(c)] else: self.atacks[_class[self.db['class']][str(c)] ['name']] = _class[self.db['class']][str(c)] atacks = eval( str(self.atacks.keys()).replace('dict_keys(', '').replace(')', '')) description = '' for c in range(0, len(atacks)): lvs = self.db['skills'][c] lvl_skill = lvs if 0 <= lvs <= 9 else 9 c2, ls = atacks[c], lvs dado = self.atacks[c2]['damage'][lvl_skill] d1 = int(dado[:dado.find('d')]) d2 = int(dado[dado.find('d') + 1:]) dd = f"{f'{d2}-{d2 * d1}' if d2 != d2 * d1 else d2}" if lvs >= 11: dd = f'{d2 + int((lvs - 10) * 10)}-{d2 * d1}' icon = self.atacks[c2]['icon'] skill_type = self.atacks[c2]['type'] try: effect_skill = str( self.atacks[c2]['effs'][lvl_skill].keys()) except KeyError: effect_skill = "sem efeito" except TypeError: effect_skill = "sem efeito" rm = int( ((self.db['status']['con'] * _class[self.db['next_class']]['rate']['mana']) / 100) * 35) ru = int( ((self.db['status']['con'] * _class[self.db['next_class']]['rate']['mana']) / 100) * 50) eff_mana = effect_skill.replace('dict_keys([', '').replace( '])', '').replace('\'', '') a_mana = self.atacks[c2]['mana'][lvl_skill] + self.db['level'] if self.db['level'] > 25: a_mana = self.atacks[c2]['mana'][lvl_skill] + ( self.db['level'] * 2) _mana = a_mana if eff_mana != "cura" else rm _mana = ru if self.atacks[c2]['type'] == "especial" else _mana damage = int(self.db['status']['atk'] * 2 / 100 * ((30 + (c * 5)) + (c * 10))) description += f"{icon} **{c2.upper()}** ``+{ls}``\n" \ f"``Dano:`` {f'**{dd} + {damage}**' if ls > 0 else f'**{damage}**'}\n``Tipo:`` " \ f"**{skill_type.upper()}**\n``Mana:`` **{_mana}**\n``Efeito(s):`` **{effect_skill}**" \ f"\n\n".replace('dict_keys([', '').replace('])', '').replace('\'', '') TM = int(self.db['status']['con'] * _class[self.db['next_class']]['rate']['mana']) embed = discord.Embed(title=f"ENCHANTER PANEL - TOTAL MANA: {TM}", description=description, color=0x000000) embed.set_thumbnail(url=member.avatar_url) _id = create_id() self.botmsg[_id] = await ctx.send(embed=embed) if not self.he[ctx.author.id][str(ctx.command)]: await self.botmsg[_id].add_reaction( '<a:help:767825933892583444>') await self.botmsg[_id].add_reaction( self.bot.config['emojis']['arrow'][4]) text = "```Markdown\n[>>]: PARA ENCANTAR UMA SKILL USE O COMANDO\n<ASH ENCHANT ADD NUMERO_DA_SKILL>```" again = False msg = None if not self.he[ctx.author.id][str(ctx.command)]: self.he[ctx.author.id][str(ctx.command)] = True while not self.bot.is_closed(): try: reaction = await self.bot.wait_for('reaction_add', timeout=30.0) while reaction[1].id != ctx.author.id: reaction = await self.bot.wait_for('reaction_add', timeout=30.0) emo = "<a:help:767825933892583444>" emoji = str(emo).replace('<a:', '').replace( emo[emo.rfind(':'):], '') emo_2 = self.bot.config['emojis']['arrow'][4] emoji_2 = str(emo_2).replace('<:', '').replace( emo_2[emo_2.rfind(':'):], '') try: try: _reaction = reaction[0].emoji.name except AttributeError: _reaction = reaction[0].emoji if _reaction == emoji and reaction[ 0].message.id == self.botmsg[ _id].id and not again: if reaction[1].id == ctx.author.id: again = True try: await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.author) except discord.errors.Forbidden: pass msg = await ctx.send(text) elif _reaction == emoji and reaction[ 0].message.id == self.botmsg[ _id].id and again: if reaction[1].id == ctx.author.id: again = False try: await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.author) except discord.errors.Forbidden: pass await msg.delete() if _reaction == emoji_2 and reaction[ 0].message.id == self.botmsg[_id].id: if reaction[1].id == ctx.author.id: self.he[ctx.author.id][str( ctx.command)] = False await self.botmsg[_id].remove_reaction( self.bot.config['emojis']['arrow'][4], ctx.me) await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.me) return except AttributeError: pass except TimeoutError: self.he[ctx.author.id][str(ctx.command)] = False await self.botmsg[_id].remove_reaction( self.bot.config['emojis']['arrow'][4], ctx.me) await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.me) return
async def equip(self, ctx): """Comando para mostrar o painel de equipamentos do seu personagem""" if ctx.invoked_subcommand is None: data = await self.bot.db.get_data("user_id", ctx.author.id, "users") try: if self.he[ctx.author.id]: if str(ctx.command) in self.he[ctx.author.id].keys(): pass else: self.he[ctx.author.id][str(ctx.command)] = False except KeyError: self.he[ctx.author.id] = {str(ctx.command): False} if not data['rpg']['active']: embed = discord.Embed( color=self.bot.color, description= '<:negate:721581573396496464>│`USE O COMANDO` **ASH RPG** `ANTES!`' ) return await ctx.send(embed=embed) eq = dict() for ky in self.bot.config['equips'].keys(): for k, v in self.bot.config['equips'][ky].items(): eq[k] = v set_armor = list() sts = {"atk": 0, "agi": 0, "prec": 0, "con": 0, "luk": 0} set_value = [ "shoulder", "breastplate", "gloves", "leggings", "boots" ] for key in data['rpg']["equipped_items"].keys(): if data['rpg']["equipped_items"][key] is not None: if key in set_value: set_armor.append(data['rpg']["equipped_items"][key]) for k in sts.keys(): try: sts[k] += eq[data['rpg']["equipped_items"] [key]]["modifier"][k] except KeyError: pass for kkk in self.bot.config["set_equips"].values(): if kkk['set'] == set_armor: for name in sts.keys(): try: sts[name] += kkk['modifier'][name] except KeyError: pass atk = self.bot.config["skills"][data['rpg'] ['class']]['modifier']['atk'] dex = self.bot.config["skills"][data['rpg'] ['class']]['modifier']['agi'] acc = self.bot.config["skills"][data['rpg'] ['class']]['modifier']['prec'] con = self.bot.config["skills"][data['rpg'] ['class']]['modifier']['con'] luk = self.bot.config["skills"][data['rpg'] ['class']]['modifier']['luk'] if data['rpg']['level'] > 25: atk += self.bot.config['skills'][ data['rpg']['next_class']]['modifier']['atk'] dex += self.bot.config['skills'][ data['rpg']['next_class']]['modifier']['agi'] acc += self.bot.config['skills'][ data['rpg']['next_class']]['modifier']['prec'] con += self.bot.config['skills'][ data['rpg']['next_class']]['modifier']['con'] luk += self.bot.config["skills"][ data['rpg']['next_class']]['modifier']['luk'] if data['rpg']['level'] > 49: atk += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_50']['atk'] dex += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_50']['agi'] acc += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_50']['prec'] con += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_50']['con'] luk += self.bot.config["skills"][ data['rpg']['next_class']]['modifier_50']['luk'] if data['rpg']['level'] > 79: atk += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_80']['atk'] dex += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_80']['agi'] acc += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_80']['prec'] con += self.bot.config['skills'][ data['rpg']['next_class']]['modifier_80']['con'] luk += self.bot.config["skills"][ data['rpg']['next_class']]['modifier_80']['luk'] data_equips = { "name": ctx.author.name, "class": str(data['rpg']['next_class']), "status_base": { "atk": str(data['rpg']['status']['atk']), "dex": str(data['rpg']['status']['agi']), "acc": str(data['rpg']['status']['prec']), "con": str(data['rpg']['status']['con']), "luk": str(data['rpg']['status']['luk']) }, "status_class": { "atk": str(atk), "dex": str(dex), "acc": str(acc), "con": str(con), "luk": str(luk) }, "status_equip": { "atk": str(sts["atk"]), "dex": str(sts["agi"]), "acc": str(sts["prec"]), "con": str(sts["con"]), "luk": str(sts["luk"]) }, "enchants": { "shoulder": data['rpg']['armors']['shoulder'], "breastplate": data['rpg']['armors']['breastplate'], "gloves": data['rpg']['armors']['gloves'], "leggings": data['rpg']['armors']['leggings'], "boots": data['rpg']['armors']['boots'], "shield": data['rpg']['armors']['shield'], "necklace": data['rpg']['armors']['necklace'], "earring": data['rpg']['armors']['earring'], "ring": data['rpg']['armors']['ring'] }, 'equipped': { "breastplate": data['rpg']["equipped_items"]['breastplate'], "leggings": data['rpg']["equipped_items"]['leggings'], "boots": data['rpg']["equipped_items"]['boots'], "gloves": data['rpg']["equipped_items"]['gloves'], "shoulder": data['rpg']["equipped_items"]['shoulder'], "sword": data['rpg']["equipped_items"]['sword'], "shield": data['rpg']["equipped_items"]['shield'], "consumable": data['rpg']["equipped_items"]['consumable'], "necklace": data['rpg']["equipped_items"]['necklace'], "earring": data['rpg']["equipped_items"]['earring'], "ring": data['rpg']["equipped_items"]['ring'] } } equips(data_equips) _id = create_id() self.botmsg[_id] = await ctx.send( file=discord.File('equips.png'), content="> `CLIQUE NA IMAGEM PARA MAIORES DETALHES`") if not self.he[ctx.author.id][str(ctx.command)]: await self.botmsg[_id].add_reaction( '<a:help:767825933892583444>') await self.botmsg[_id].add_reaction( self.bot.config['emojis']['arrow'][4]) text = "```Markdown\n[>>]: PARA EQUIPAR UM ITEM USE O COMANDO\n<ASH EQUIP ITEM NOME_DO_ITEM>\n" \ "[>>]: PARA RESETAR OS EQUIPAMENTOS USE O COMANDO\n<ASH EQUIP RESET>\n\n" \ "[>>]: PARA MAIS INFORMAÇÕES USE O COMANDO\n<ASH EQUIP INFO>```" again = False msg = None if not self.he[ctx.author.id][str(ctx.command)]: self.he[ctx.author.id][str(ctx.command)] = True while not self.bot.is_closed(): try: def check(react, member): try: if react.message.id == self.botmsg[_id].id: if member.id == ctx.author.id: return True return False except AttributeError: return False reaction = await self.bot.wait_for('reaction_add', timeout=30.0, check=check) emo = "<a:help:767825933892583444>" emoji = str(emo).replace('<a:', '').replace( emo[emo.rfind(':'):], '') emo_2 = self.bot.config['emojis']['arrow'][4] emoji_2 = str(emo_2).replace('<:', '').replace( emo_2[emo_2.rfind(':'):], '') try: try: _reaction = reaction[0].emoji.name except AttributeError: _reaction = reaction[0].emoji if _reaction == emoji and reaction[ 0].message.id == self.botmsg[ _id].id and not again: if reaction[1].id == ctx.author.id: again = True perms = ctx.channel.permissions_for(ctx.me) if perms.manage_messages: await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.author) msg = await ctx.send(text) elif _reaction == emoji and reaction[ 0].message.id == self.botmsg[ _id].id and again: if reaction[1].id == ctx.author.id: again = False perms = ctx.channel.permissions_for(ctx.me) if perms.manage_messages: await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.author) await msg.delete() if _reaction == emoji_2 and reaction[ 0].message.id == self.botmsg[_id].id: if reaction[1].id == ctx.author.id: self.he[ctx.author.id][str( ctx.command)] = False perms = ctx.channel.permissions_for(ctx.me) if perms.manage_messages: await self.botmsg[_id].remove_reaction( self.bot.config['emojis']['arrow'] [4], ctx.me) await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.me) return except AttributeError: pass except TimeoutError: self.he[ctx.author.id][str(ctx.command)] = False perms = ctx.channel.permissions_for(ctx.me) if perms.manage_messages: await self.botmsg[_id].remove_reaction( self.bot.config['emojis']['arrow'][4], ctx.me) await self.botmsg[_id].remove_reaction( "<a:help:767825933892583444>", ctx.me) return