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

Infinite Message Length for Streaming #56

Closed
kevinthedang opened this issue May 1, 2024 · 0 comments · Fixed by #70
Closed

Infinite Message Length for Streaming #56

kevinthedang opened this issue May 1, 2024 · 0 comments · Fixed by #70
Assignees
Labels
enhancement New feature or request

Comments

@kevinthedang
Copy link
Owner

Issue

  • Infinite Message Lengths were implemented for block messages in Infinite Message Length for Block Messages #55, however support for infinite streamed messages would be nice too!
  • It might be a bit more difficult to implement this for embedded messages, but they should both be just fine.

Notes

  • Below is what it currently is. Might want to figure out how to work around the for await in TypeScript.

Sample from messageNormal.ts

// run query based on stream preference, true = stream, false = block
if (stream) {
    response = await streamResponse(params)
    for await (const portion of response) {
        // append token to message
        result += portion.message.content

        // exceeds handled length
        if (result.length > 2000) {
            message.channel.send(`Response length ${result.length} has exceeded Discord maximum.\n\nLong Stream messages not supported.`)
            break // stop stream
        }

        // resent current output, THIS WILL BE SLOW due to discord limits!
        sentMessage.edit(result || 'No Content Yet...')
    }
} else { ... }
@kevinthedang kevinthedang added the enhancement New feature or request label May 1, 2024
@kevinthedang kevinthedang self-assigned this Jun 16, 2024
@kevinthedang kevinthedang linked a pull request Jun 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant