Slackbot + Heroku: Have to keep logging in - heroku

I'm having an issue with my botkit slack bot hosted on Heroku. The bot itself is just the "starter kit."
https://github.com/howdyai/botkit-starter-slack
After a little while, the bot stops working. The logs complain of not being able to find the team. I hit the /login path of my heroku-deployed app and allow it and it works again for a bit.
Is there a heroku configuration that I need to change to keep it from going idle or something? Or is this an issue with the starter kit? Could there be something I need to do in the slack configuration?

I am pretty sure that you run your bot on a hobby dyno. Heroku sends hobby dynos to sleep if they dont receive any requests.
What had happened:
You deployed the bot -> the bot is running and working
Everybody can write with the bot -> so great!
After a few minutes, while the bot is not used, the dyno falls asleep
At this moment the bot is not working
You hit the /login request and yeah -> the dyno starts again and the bot is running and working
Read more about free dynos here: https://devcenter.heroku.com/articles/free-dyno-hours.
Solution: Switch to Standard Dynos

Related

How do I turn on/off my discord bot worker on heroku using Discord command?

I have a discord bot deployed to Heroku and I don't want to open the heroku website every time in order to turn on/off my discord bot from the worker tray. Is there a way to control my discord bot from discord commands using another managing bot?
You can configure your managing bot to use and make calls to the Heroku Platform API's.
Particularly, the Dyno section specifies how you can Create, Restart and Stop your Dynos by making API calls by passing in your App ID/Name and Dyno ID/Name.

Why isn't my Heroku hosting discord bot going online?

[Hello, i am a complete cookie to coding so need some help.
I made a discord ModMail Bot using this repository(https://github.com/kyb3r/modmail) and used heroku to deploy the worker. Everything worked out and bot was working smoothly, but today it went offline, and when i tried restarting the worker, this messages show up. PLease help.]Code error
Your bot does not stay permanently online when using heroku.
You'll have to wait until the bot eventually comes online, or pay for more dyno hours, which at this point, you could just host your bot on a VPS

My bot is staying online even after I've shut down all possible hosts

Today I noticed that my bot was sending double messages (usually means that it's running 2 clients). After I shut down my bot from heroku, it was still online. Any idea how can I fix this?
Check if you are running the bot locally, and make sure all servers linked to the bot are turned off, sometimes the bot takes a while to completely shut down and go offline in discord, so try waiting for a few minutes.
in Heroku => navigate to resources tab and turn off npm worker: start

Microsoft Bot is not responding in either Teams nor the Bot Emulator

I have:
The corresponding Web-App running on localhost.
An open channel for MS Teams active within the Bot Framework, which displays 'running' all the time (no issues).
downloaded a VS19 project from git with a few pre-set bot-commands.
However, when I host the app via ngrok and try to contact the bot via teams the dropdown menu with the commands is diplayed, but the the bot replies to none of them.
When using the Bot Emulator, it also does not react to any messages (see below).
You said:
hello
Restart conversation from here
You said:
help
Restart conversation from here
Connectivity Status: Connected
Suggested Actions Container: Is empty
[10:03:51]Connecting to bot on https://localhost:3979/api/messages
[10:03:51]Emulator listening on http://[::]:58187
[10:03:52]-> conversationUpdate
[10:03:52]ngrok listening on https://67fe6eb30077.ngrok.io
[10:03:52]ngrok traffic inspector:http://127.0.0.1:4040
[10:03:52]Will bypass ngrok for local addresses
[10:03:52]POST400directline/conversations/<conversationId>/activities
[10:03:58]-> message hello
Since i was unable to resolve the issue I started the registration process over, this times with our tenants account. It didn't change very much except for causing an AADSTS700016-Error server side. After some research I stumbled accross this article, which explains the issue but also shows the solution, namely setting "signInAudience": "AzureADandPersonalMicrosoftAccount" in the registration manifest. This option was not available for my app for some reason so I set it to "signInAudience": "AzureADMultipleOrgs", which resolved the issue for now.

Testing issue with LUIS bot on Bot framework emulator

I am following this guide to develop chatbot:
https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-v4-luis?view=azure-bot-service-4.0&tabs=csharp#test-the-bot
When I tried to test the bot with Bot Framework Emulator, I am unable to get a response.
[15:17:43]Emulator listening on http://[::]:60595
[15:17:43]ngrok not configured (only needed when connecting to remotely hosted bots)
[15:17:43]Connecting to bots hosted remotely
[15:17:43]Edit ngrok settings
[15:17:43]-> conversationUpdate
[15:17:44]POST500directline/conversations/<conversationId>/activities
[15:17:51]-> messagehi
[15:17:51]POST500directline/conversations/<conversationId>/activities
Is this have to do with my company security blocking ngrok?
My Echo bot works fine, but seems like I am having issue with the LUIS function. Is there a way to make it work and link it to MS teams?
Help needed

Resources