mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
🐛 fix(makeprompt.py): fix off-by-one error in limit check when fetching message history
✨ feat(makeprompt.py): include the original message in the fetched message history
This commit is contained in:
@@ -43,8 +43,10 @@ async def fetch_messages_history(channel: discord.TextChannel, limit, original_m
|
||||
async for msg in channel.history(limit=100, before=original_message):
|
||||
if not is_ignorable(msg.content):
|
||||
messages.append(msg)
|
||||
if len(messages) == limit:
|
||||
if len(messages) == limit-1:
|
||||
break
|
||||
|
||||
messages.append(original_message)
|
||||
messages.reverse()
|
||||
return messages
|
||||
|
||||
|
||||
Reference in New Issue
Block a user