-
Notifications
You must be signed in to change notification settings - Fork 24
Discord Integration Example #44
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
Conversation
|
No applications have been configured for previews targeting branch: main. To do so go to restack console and configure your applications for previews. |
|
@justrdk Here is a simple human-in-the-loop example using the Discord API in the Restack workflow |
|
Here is a demo of the Discord loop: |
|
@venerjoel99 isn't there a way to get events when a message is sent on the server instead of polling messages in the workflow? |
|
|
||
|
|
||
| while (!endWorkflow) { | ||
| await new Promise(f => setTimeout(f, 1000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you an use the "sleep" function from @restackio/ai/workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the sleep to the scheduleWorkflow.ts file, but I can't use the sleep function in that file since it's not allowed to be used outside of a workflow execution
I can make a real-time event-based workflow example. I will respond here once I add the example here |
perfect, to have the workflow keep on running while waiting on events you can use the "condition" functions from |
|
@justrdk I have made changes to sending events to the Restack workflow based on real-time Discord messaging events picked up by the bot |
Partial revert: updated human-loop by accident
This example showcases an example of a human-in-the-loop workflow with Discord. The workflow will do the following: