Skip to content

Commit 224d465

Browse files
committed
Fix chat output
1 parent db7f8ce commit 224d465

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/my_discord_bot/cogs/_cog_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def check_cooldown_factory(
13-
seconds: int = 10,
13+
seconds: float = 10,
1414
) -> ty.Callable[[discord.Interaction], discord.app_commands.Cooldown | None]:
1515
"""Global cooldown for commands."""
1616

src/my_discord_bot/cogs/ai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(
2323
self.model_name = os.getenv("OPENAI_MODEL_NAME", "")
2424

2525
@discord.app_commands.command()
26-
@discord.app_commands.checks.dynamic_cooldown(check_cooldown_factory(3))
26+
@discord.app_commands.checks.dynamic_cooldown(check_cooldown_factory(1.5))
2727
@discord.app_commands.guild_only()
2828
@discord.app_commands.describe(
2929
message="Message to the AI.",
@@ -57,5 +57,5 @@ async def chat(
5757
await ia.followup.send(message[:2000])
5858

5959
if len(message) > 2000:
60-
for split in range(1, math.ceil(len(message) / 2000) + 1):
60+
for split in range(1, math.ceil(len(message) / 2000)):
6161
await ia.followup.send(message[2000 * split : 2000 * (split + 1)])

0 commit comments

Comments
 (0)