Add merge command

This commit is contained in:
Robert Miles 2021-06-30 07:53:30 +00:00
parent 976cf41282
commit ed376b77ed
1 changed files with 14 additions and 0 deletions

View File

@ -169,6 +169,19 @@ def admin_redocache(event):
redo_score_cache()
respond(event,"Score cache redone!")
def admin_merge(event):
try:
target, from_ = event.parts
except:
respond(event,"Syntax: admin merge <target> <from>")
return
bungame_data["buns"][target].extend(bungame_data["buns"][from_])
bungame_data.save()
del bungame_data["buns"][from_]
bungame_data.save()
redo_score_cache()
respond(event,"Should be merged now!")
def register(bot):
global BOT
BOT=bot
@ -180,3 +193,4 @@ def register(bot):
bot.event_manager.on("command_stats",on_stats)
bot.event_manager.on("command_top10",on_top10)
bot.event_manager.on("admin_redocache",admin_redocache)
bot.event_manager.on("admin_merge",admin_merge)