|
9 | 9 | load_dotenv(override=True) |
10 | 10 |
|
11 | 11 | with open("projects/Chat-GPT-Discord-Bot/GPT_Parameters.json") as f: |
12 | | - data = json.load(f) |
| 12 | + data = json.load(f) # Loads the gpt system prompts |
13 | 13 |
|
14 | | -char_limit = data["system_content"][0]["character_limit_prompt"] |
| 14 | +char_limit = data["system_content"][0]["character_limit_prompt"] # Makes sure that the gpt output wont exceed the discord embed character limit of 4096 characters |
15 | 15 |
|
16 | 16 | try: |
17 | 17 | token = os.getenv("BOT_TOKEN") # returns a str |
@@ -198,6 +198,7 @@ async def send(interaction: discord.Interaction, text: str): # noqa: F811 |
198 | 198 | ephemeral=False |
199 | 199 | ) # Defer the response to prevent command timeout |
200 | 200 |
|
| 201 | + # 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 |
201 | 202 | embed = discord.Embed( |
202 | 203 | title="Correct Grammar", |
203 | 204 | description=gpt( |
@@ -237,6 +238,7 @@ async def send(interaction: discord.Interaction, text: str): # noqa: F811 |
237 | 238 | ephemeral=False |
238 | 239 | ) # Defer the response to prevent command timeout |
239 | 240 |
|
| 241 | + # 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 |
240 | 242 | embed = discord.Embed( |
241 | 243 | title="Single Page Website", |
242 | 244 | description=gpt( |
@@ -281,6 +283,7 @@ async def send(interaction: discord.Interaction, text: str): # noqa: F811 |
281 | 283 | else: |
282 | 284 | gpt_prompt = text |
283 | 285 |
|
| 286 | + # 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 |
284 | 287 | embed = discord.Embed( |
285 | 288 | title=f'Text to Emoji - "{text}"', |
286 | 289 | description=gpt( |
@@ -319,6 +322,7 @@ async def send(interaction: discord.Interaction, text: str): # noqa: F811 |
319 | 322 | ephemeral=False |
320 | 323 | ) # Defer the response to prevent command timeout |
321 | 324 |
|
| 325 | + # 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 |
322 | 326 | embed = discord.Embed( |
323 | 327 | title="Text to block letter emojis", |
324 | 328 | description=gpt( |
@@ -355,6 +359,7 @@ async def send(interaction: discord.Interaction, text: str): # noqa: F811 |
355 | 359 | ephemeral=False |
356 | 360 | ) # Defer the response to prevent command timeout |
357 | 361 |
|
| 362 | + # 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 |
358 | 363 | embed = discord.Embed( |
359 | 364 | title="Code Debug", |
360 | 365 | description=gpt( |
@@ -393,6 +398,7 @@ async def send(interaction: discord.Interaction, text: str): # noqa: F811 |
393 | 398 | ephemeral=False |
394 | 399 | ) # Defer the response to prevent command timeout |
395 | 400 |
|
| 401 | + # 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 |
396 | 402 | embed = discord.Embed( |
397 | 403 | title="Short Story", |
398 | 404 | description=gpt( |
@@ -437,6 +443,7 @@ async def send(interaction: discord.Interaction, text: str): # noqa: F811 |
437 | 443 | else: |
438 | 444 | gpt_prompt = text |
439 | 445 |
|
| 446 | + # 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 |
440 | 447 | embed = discord.Embed( |
441 | 448 | title=f'General Question - "{text}"', |
442 | 449 | description=gpt( |
|
0 commit comments