Welcome to the step-by-step guide on how to use the Custom Poll Creation Template on the Lazy platform. This template allows you to easily create and manage interactive polls within Slack channels. With this app, you can post polls, collect responses, and display real-time results, all through simple slash commands and button interactions. This guide will walk you through the process of setting up and deploying your custom poll app on Slack using Lazy.
To begin using this template, click on "Start with this Template" on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code manually.
Before testing the app, you need to set up the necessary environment secrets. These are not the same as environment variables in your operating system; they are secrets that can be set in the Environment Secrets tab within the Lazy Builder.
You will need to set up the following environment secrets:
Make sure to acquire these tokens from your Slack app settings and add them as environment secrets in the Lazy Builder interface.
Once you have added the necessary environment secrets, you can deploy the app by pressing the "Test" button. This will begin the deployment process and launch the Lazy CLI. The Lazy platform handles all deployment aspects, so you don't need to worry about installing libraries or setting up your environment.
After deploying the app, you can use the custom poll feature in your Slack workspace. Invoke the poll creation by typing the /poll
command in any channel where the bot is present. A modal will appear, prompting you to enter the poll question and options. Once submitted, an interactive message with the poll options will be posted in the channel, and users can start voting.
To integrate this app into your Slack workspace, you need to ensure that your Slack bot has the following scopes:
Add these scopes in your Slack app settings under the OAuth & Permissions section. After adding the scopes, reinstall the app to your workspace to apply the changes.
If your app uses additional features or requires further integration with Slack or other services, follow the specific instructions provided in the documentation or the code comments.
That's it! You've successfully set up and deployed a custom poll creation app in Slack using the Lazy platform. Enjoy engaging with your team through interactive polls!
This app allows users to interact with a Slack bot, ask a question about the data in a table or request the table schema, and then uses the latest ChatGPT to generate a query that is executed on BigQuery to return the results. The app includes a retry mechanism for query generation in case of an error (up to two retries) and provides the LLM with the table info to generate more accurate queries. The table schema is only printed if it is successfully retrieved. All errors from retries are now passed to the LLM. The generated query is printed before the results, and the results are displayed in a pretty table format. The bot uses the Slack API to send and receive messages and parses the user's message to determine the action to take. The bot always responds in a thread to the original message.