Track bot commands/replies for later deletion

master
Thor 3 years ago
parent 047c57a32d
commit f9e5ea2697
  1. 4
      cringebot.py

@ -56,7 +56,8 @@ class CringeBotClient(BotClient):
def respond(self, status, message):
self.log("Responded with:")
self.log(message)
self.api.status_reply(status, "{}\n{}".format(message, self.config["tag"]), visibility = "direct", untag = True)
reply = self.api.status_reply(status, "{}\n{}".format(message, self.config["tag"]), visibility = "direct", untag = True)
self.track_status(reply)
time.sleep(1)
def on_status(self, status):
@ -98,6 +99,7 @@ class CringeBotClient(BotClient):
replied_tokens = self.h2t.handle(replied_status["content"]).split()
if self.config["tag"] in replied_tokens:
self.track_status(status)
target_status_id = replied_status.get("in_reply_to_id", None)
if target_status_id:
try:

Loading…
Cancel
Save