Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of non-existent ctx.history.filter #1380

Merged
merged 2 commits into from
Oct 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions bot/exts/fun/snakes/_snakes_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,12 +1058,11 @@ async def snakify_command(self, ctx: Context, *, message: str | None = None) ->
if not message:

# Get a random message from the users history
messages = []
async for message in ctx.history(limit=500).filter(
lambda msg: msg.author == ctx.author # Message was sent by author.
):
messages.append(message.content)

messages = [
message.content
async for message in ctx.history(limit=500)
if message.author == ctx.author
]
message = self._get_random_long_message(messages)

# Build and send the embed
Expand Down