Implement nuke command to remove all ads

pull/1/head
Mark Veidemanis 3 years ago
parent 80f0d4a5fd
commit d060120c9b
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -60,6 +60,10 @@ class IRCCommands(object):
msg("---") msg("---")
elif length == 2: 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) messages = agora.get_messages(spl[1], send_irc=False)
if not messages: if not messages:
msg("No messages.") msg("No messages.")
@ -74,7 +78,10 @@ class IRCCommands(object):
def run(cmd, spl, length, authed, msg, agora, revolut, tx): def run(cmd, spl, length, authed, msg, agora, revolut, tx):
# Distribute out our ad to all countries in the config # Distribute out our ad to all countries in the config
for x in agora.dist_countries(): 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): class find(object):
name = "find" name = "find"
@ -212,3 +219,12 @@ class IRCCommands(object):
return return
rtrn = agora.release_funds(tx) rtrn = agora.release_funds(tx)
msg(dumps(rtrn)) 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))

Loading…
Cancel
Save