Unhandled request ({'type': 'event_callback', 'event': {'type': 'message'}}) --- [Suggestion] You can handle this type of event with the following listener function:
See original GitHub issueI wanted to test my script with a simple message and I get the error mentioned in the title, my main goal is to read what the user has sent in the main chat and then send the open and close price of a given stock using yfinance. I was also having hard time finding the home page for my server as I tried one of the example code given in the documentation and I don’t see if being dispalyed any where in my channel, do I need to make a new channel for that.
CODE:
load_dotenv()
env_path = Path('.')/ '.env'
load_dotenv(dotenv_path=env_path)
app = Flask(__name__)
app = App(
token=os.environ.get("SLACK_TOKEN"),
signing_secret=os.environ.get("SIGNING_SECRET")
)
if __name__ == "__main__":
app.start(port=int(os.environ.get("PORT", 3000)))
@app.message("knock knock")
def ask_who(message, say):
say("_Who's there?_")
I am also running the ngrok local server as well, I am very new to this so most of the documentation was confusing to me
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Bolt for Python - Slack Platform Developer Tools
To listen to messages that your app has access to receive, you can use the message() method which filters out events that aren't...
Read more >ASP.NET Core Blazor event handling - Microsoft Learn
Learn about Blazor's event handling features, including event argument types, event callbacks, and managing default browser events.
Read more >AutoCompleteTextView - Android Developers
android:completionThreshold, Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.
Read more >slackapi/bolt-python v1.6.0 on GitHub - NewReleases.io
App:Unhandled request ({'type': 'event_callback', 'event': {'type': 'message'}}) --- [Suggestion] You can handle this type of event with the following ...
Read more >How To Send Parameters To Event CallBacks In Blazor
The following is the 5 step approach, this will help you to understand ... "OnProductSelected" is a type of EventCallback which is an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you very much for responding, I think this answers most of my questions. So I have the following code:
in my case I want tickerWant to be whatever the ticker the user sends, so I can just do this correct:
and then use the def print_message function? EDIT: Problem has been fixed thank you very much for your patience in helping me 😃
If you mean that you want to listen for all messages that the user sends, we recommend using the
@app.event('message')listener, accessing the message text as seen below:To note: these message listeners will also pick up messages sent by apps, so if you want to filter those out, you can write some additional logic and return early if the event has a subtype of
bot_message.Usually, we think of the Home Tab as the “home page” for apps. This is where your users can find all useful and pertinent information related to your app. You can learn more about the Home Tab here.
As for a “home channel”, it’s entirely up to you which channel(s) you add your bot to! 🙂
You can definitely do so! One way to accomplish this is by using a helper function. This allows you to pass the message text elsewhere (outside of the listener function) to process.
The below snippet is an edit of the above and might be a good place for you to start from:
Let us know if the above resolves the issue(s) raised!