Implement nuke command to remove all ads

This commit is contained in:
Mark Veidemanis 2021-12-30 14:15:34 +00:00
parent 80f0d4a5fd
commit d060120c9b
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 17 additions and 1 deletions

View File

@ -60,6 +60,10 @@ class IRCCommands(object):
msg("---")
elif length == 2:
tx = tx.ref_to_tx(spl[1])
if not tx:
msg(f"No such reference: {spl[1]}")
return
messages = agora.get_messages(spl[1], send_irc=False)
if not messages:
msg("No messages.")
@ -74,7 +78,10 @@ class IRCCommands(object):
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
# Distribute out our ad to all countries in the config
for x in agora.dist_countries():
msg(dumps(x))
if x["success"]:
msg(f"{x['response']['data']['message']}: {x['response']['data']['ad_id']}")
else:
msg(x["response"]["data"]["message"])
class find(object):
name = "find"
@ -212,3 +219,12 @@ class IRCCommands(object):
return
rtrn = agora.release_funds(tx)
msg(dumps(rtrn))
class nuke(object):
name = "nuke"
authed = True
@staticmethod
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
rtrn = agora.nuke_ads()
msg(dumps(rtrn))