Spaces:
Running
Running
Update chatgpt.py
Browse files- chatgpt.py +4 -3
chatgpt.py
CHANGED
|
@@ -12,7 +12,7 @@ MESSAGES_URL = f"https://desk-api.channel.io/desk/channels/{CHANNEL_ID}/groups/{
|
|
| 12 |
|
| 13 |
X_ACCOUNT = os.getenv("dmsendertoken")
|
| 14 |
if not X_ACCOUNT:
|
| 15 |
-
raise RuntimeError("環境変数
|
| 16 |
|
| 17 |
HEADERS = {
|
| 18 |
"accept": "application/json",
|
|
@@ -127,7 +127,7 @@ def main():
|
|
| 127 |
)
|
| 128 |
|
| 129 |
latest_id = latest.get("id")
|
| 130 |
-
latest_person = str(latest.get("
|
| 131 |
latest_text = latest.get("plainText")
|
| 132 |
|
| 133 |
# 空メッセージは無視
|
|
@@ -140,6 +140,7 @@ def main():
|
|
| 140 |
time.sleep(10)
|
| 141 |
continue
|
| 142 |
|
|
|
|
| 143 |
if latest_person == ASSISTANT_PERSON_ID:
|
| 144 |
time.sleep(10)
|
| 145 |
continue
|
|
@@ -163,4 +164,4 @@ def main():
|
|
| 163 |
|
| 164 |
|
| 165 |
if __name__ == "__main__":
|
| 166 |
-
main()
|
|
|
|
| 12 |
|
| 13 |
X_ACCOUNT = os.getenv("dmsendertoken")
|
| 14 |
if not X_ACCOUNT:
|
| 15 |
+
raise RuntimeError("環境変数 channeliotokenbot2 が設定されていません")
|
| 16 |
|
| 17 |
HEADERS = {
|
| 18 |
"accept": "application/json",
|
|
|
|
| 127 |
)
|
| 128 |
|
| 129 |
latest_id = latest.get("id")
|
| 130 |
+
latest_person = str(latest.get("personId"))
|
| 131 |
latest_text = latest.get("plainText")
|
| 132 |
|
| 133 |
# 空メッセージは無視
|
|
|
|
| 140 |
time.sleep(10)
|
| 141 |
continue
|
| 142 |
|
| 143 |
+
# 最後が GPT(595702)なら何もしない
|
| 144 |
if latest_person == ASSISTANT_PERSON_ID:
|
| 145 |
time.sleep(10)
|
| 146 |
continue
|
|
|
|
| 164 |
|
| 165 |
|
| 166 |
if __name__ == "__main__":
|
| 167 |
+
main()
|