fixed bug in pkmn, moved pkmn msg counter to cog
This commit is contained in:
parent
d90c8a4418
commit
6aede9296b
2 changed files with 92 additions and 91 deletions
|
|
@ -212,17 +212,6 @@ async def on_reaction_add(reaction, user):
|
|||
message = reaction.message
|
||||
emoji = reaction.emoji
|
||||
await message.add_reaction(emoji)
|
||||
|
||||
|
||||
async def pkmn_msg(discord_id):
|
||||
path = "databases/pokemon/"+str(discord_id)+'.json'
|
||||
if os.path.isfile(path):
|
||||
with open(path, 'r') as f:
|
||||
json_data = json.loads(f.readline())
|
||||
json_data['buddy_xp'] += random.randint(1,5)
|
||||
json_data = json.dumps(json_data)
|
||||
with open(path, 'w') as f:
|
||||
f.writelines(json_data)
|
||||
|
||||
|
||||
@bot.event
|
||||
|
|
@ -232,9 +221,6 @@ async def on_message(ctx):
|
|||
channel_vars = await get_channel_config(ctx.channel.id)
|
||||
chat_history_string = await log_chat_and_get_history(ctx, logfile, channel_vars)
|
||||
|
||||
#add pokemon xp
|
||||
await pkmn_msg(ctx.author.id)
|
||||
|
||||
#handle non-text channels (dms, etc)
|
||||
if ctx.channel.type.value != 0 and ctx.author.id != 242018983241318410:
|
||||
#This used to notify the user it cannot respond in this channel, but that spammed threads
|
||||
|
|
@ -242,7 +228,7 @@ async def on_message(ctx):
|
|||
|
||||
await react_to_msg(ctx, channel_vars["react_to_msgs"]) #emoji reactions
|
||||
|
||||
if channel_vars["commands_enabled"] or (ctx.author.id == 242018983241318410 and ctx.content[0] == "!"):
|
||||
if channel_vars["commands_enabled"] or (ctx.author.id == 242018983241318410 and ctx.content[0] == "?"):
|
||||
await bot.process_commands(ctx)
|
||||
if not channel_vars["commands_enabled"]:
|
||||
await ctx.channel.send("This command only ran because you set it to allow to run even when commands are disabled")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue