فهرست منبع

Add flag for enabling replies in groupme driver

Kirk Trombley 3 سال پیش
والد
کامیت
52fc3defd5
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      drivers/groupme_driver.py

+ 2 - 1
drivers/groupme_driver.py

@@ -22,6 +22,7 @@ with open(os.environ.get("SECRET_FILE", "secrets.toml"), "r") as sfile:
 database_file = os.environ.get("DATABASE_FILE", secrets["database_file"])
 groupme_bots = secrets["groupme"]["bots"]
 groupme_token = secrets["groupme"]["token"]
+replies_enabled = secrets["groupme"].get("replies_enabled", True)
 groupme_admins = secrets["admins"]["origin"]
 group_admins = secrets["admins"]["channel"]
 
@@ -143,7 +144,7 @@ class GroupMeBot(rollbot.Rollbot[GroupMeMessage]):
                             )
                         else:
                             attachments.append({"type": "image", "url": att.body})
-                    if att.name == "reply":
+                    if replies_enabled and att.name == "reply":
                         if att.body is None or not isinstance(att.body, str):
                             raise ValueError("Invalid reply body type, must be message ID")
                         attachments.append({