Skip to content

Commit 11c9823

Browse files
committed
AssistantUtils - fix BadArgument for fetching channel history
1 parent 0fdc74c commit 11c9823

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

assistantutils/common/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ async def fetch_channel_history(
210210

211211
try:
212212
timedelta = commands.parse_timedelta(delta)
213-
except (ValueError, TypeError):
213+
except (ValueError, TypeError, commands.BadArgument):
214214
timedelta = None
215215

216216
# Start fetching the content

assistantutils/common/schemas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
}
5656
FETCH_CHANNEL_HISTORY = {
5757
"name": "fetch_channel_history",
58-
"description": "Fetch the last X messages from a channel to see their content.",
58+
"description": "Fetch messages from a Discord channel over a specified limit or time delta.",
5959
"parameters": {
6060
"type": "object",
6161
"properties": {
@@ -70,7 +70,7 @@
7070
},
7171
"delta": {
7272
"type": "string",
73-
"description": "The time delta to filter messages by, in the format 'XdXhXmXs' (e.g., '1d2h30m' for 1 day, 2 hours, and 30 minutes). If this is provided, it will use the delta instead of the limit. If not provided, the default `limit` will be used",
73+
"description": "The time delta to filter messages by, in the format 'XdXhXmXs' (e.g., '1d2h30m' for 1 day, 2 hours, and 30 minutes. MAX 2d). If this is provided, it will use the delta instead of the limit. If not provided, the default `limit` will be used",
7474
"default": "",
7575
},
7676
},

assistantutils/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AssistantUtils(Functions, commands.Cog, metaclass=CompositeMetaClass):
2727
"""
2828

2929
__author__ = "[vertyco](https://github.com/vertyco/vrt-cogs)"
30-
__version__ = "1.0.2"
30+
__version__ = "1.0.3"
3131

3232
def __init__(self, bot: Red):
3333
super().__init__()

0 commit comments

Comments
 (0)