Skip to content

Added support for internal filtering with createTranscript method #174

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

Merged
merged 7 commits into from
Jun 14, 2024

Conversation

fronkdev
Copy link
Contributor

@fronkdev fronkdev commented Jun 4, 2024

With this PR, you're able to directly filter messages with the createTranscript method without the need of having to fetch and filter messages yourself and parse them into the generateFromMessages method.

I have:

  • Updated and tested typings
  • Updated and tested createTranscript

Tested Code:

  const attachment = await createTranscript(channel, {
    // Filter bot messages
    filter: (message) => !message.author.bot
  });

The below attachment is the result of the above tested code. You can see that the only messages are from me and the attachment (of the actual channel in Discord) shows the same messages but including Dyno, a bot, which I am filtering out in the test.
TranscriptLog

fronkdev and others added 7 commits June 4, 2024 18:37
Testing "filter" option for createTranscript method
Adding 'filter' typing to CreateTranscriptOptions
Adding filtering logic to createTranscript method
Fixed lastMessageId
Fixed early breaking (filtered collection will most likely be less than 100 therefore would break)
@ItzDerock ItzDerock merged commit aa5ca76 into ItzDerock:master Jun 14, 2024
5 checks passed
@ZerlsDev ZerlsDev mentioned this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants