You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 24, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: projects/Chat-GPT-Discord-Bot/main.py
+16-3Lines changed: 16 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@
41
41
42
42
classMyClient(discord.Client):
43
43
def__init__(self, *, intents: discord.Intents):
44
-
super().__init__(heartbeat_timeout=90, intents=intents) # heartbeat_timeout=90 prevents the bot disconnecting from discord when running the dalle commands
44
+
super().__init__(heartbeat_timeout=120, intents=intents) # heartbeat_timeout prevents the bot disconnecting from discord when running the dalle commands
45
45
# A CommandTree is a special type that holds all the application command
46
46
# state required to make it work. This is a separate class because it
"Invalid GPT model. Must be either gpt-4 or gpt-3.5."
453
+
)
454
+
return
455
+
else:
456
+
ifgpt_model.lower() =="gpt-3.5":
457
+
gpt_model="gpt-3.5-turbo-16k"
458
+
else:
459
+
gpt_model=gpt_model.lower()
460
+
448
461
449
462
# It is best to use discord embeds for gpt commands as discord embed descriptions allow for 4096 characters instead of 2000 characters for normal messages
0 commit comments