From f9e5ea2697ae5eaa6ab549eba35a39f790ff9e0b Mon Sep 17 00:00:00 2001 From: Thor Harald Johansen Date: Wed, 14 Jul 2021 15:21:19 +0200 Subject: [PATCH] Track bot commands/replies for later deletion --- cringebot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cringebot.py b/cringebot.py index 078de80..f3902bd 100644 --- a/cringebot.py +++ b/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: