Skip to content

Commit

Permalink
dd !train nominate to allow users to nominate managers, without manag…
Browse files Browse the repository at this point in the history
…er input
  • Loading branch information
doonce committed Jan 8, 2020
1 parent 8dbd9ef commit a1a42b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions meowth/exts/huntr.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async def on_raw_reaction_add(self, payload):
pokealarm_dict = copy.deepcopy(ctx.bot.guild_dict[channel.guild.id].get('pokealarm_dict', {}))
pokehuntr_dict = copy.deepcopy(ctx.bot.guild_dict[channel.guild.id].get('pokehuntr_dict', {}))
raid_cog = self.bot.cogs.get('Raid')
if message.id in pokealarm_dict.keys() and not user.bot:
if raid_cog and message.id in pokealarm_dict.keys() and not user.bot:
if str(payload.emoji) == self.bot.custom_emoji.get('huntr_report', u'\U00002705'):
await self.on_pokealarm(ctx, user)
elif str(payload.emoji) == self.bot.custom_emoji.get('raid_maybe', u'\U00002753'):
Expand Down Expand Up @@ -164,7 +164,7 @@ async def on_raw_reaction_add(self, payload):
await ctx.invoke(self.bot.get_command("list pokealarms"), type="pokealarm")
await asyncio.sleep(5)
await utils.safe_reaction(message, payload.emoji)
elif message.id in pokehuntr_dict.keys() and not user.bot:
elif raid_cog and message.id in pokehuntr_dict.keys() and not user.bot:
if str(payload.emoji) == self.bot.custom_emoji.get('huntr_report', u'\U00002705'):
await self.on_huntr(ctx, user)
elif str(payload.emoji) == self.bot.custom_emoji.get('raid_maybe', u'\U00002753'):
Expand Down
3 changes: 2 additions & 1 deletion meowth/exts/raid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3300,7 +3300,7 @@ def check(reaction, user):
if reaction.message.id == question.id and (reaction.emoji == yes_emoji or reaction.emoji == no_emoji):
if reaction.emoji == yes_emoji and user in manager_list and user != ctx.guild.me:
return True
if reaction.emoji == no_emoji:
if reaction.emoji == no_emoji and user != ctx.guild.me:
return True
return False
question = await ctx.send(f"Meowth! {ctx.author.mention} nominates {member.mention} as a train leader! {manager_str}All others can object with {no_emoji}. If nobody objects with {no_emoji} in 60 seconds, {member.display_name} will be added as a train manager.")
Expand All @@ -3315,6 +3315,7 @@ def check(reaction, user):
if timeout or reaction.emoji == no_emoji:
return await ctx.send(f"Meowth! The vote for {member.display_name} has failed.", delete_after=10)
else:
self.bot.guild_dict[ctx.guild.id]['raidtrain_dict'][ctx.channel.id]['managers'].append(member.id)
await ctx.send(f"Meowth! I added **{member.display_name}** as a manager! {member.mention}, check your DMs for instructions!")
return await member.send(embed=manager_embed, delete_after=3600)
else:
Expand Down

0 comments on commit a1a42b0

Please sign in to comment.