Overwriting bot names and images with the same bot in different channels - discord.py

I have a discord bot in about 50 servers. I was wondering if it was possible for me to overwrite the bot username and image with the server that its in.
So for example my bot is called "My Bot" and has the image "MyBot.png"
Server 1 uses a command on my bot and it responds with the name "Their server" and the image "TheirServer.png"
I have seen some posts about being able to overwrite the bots name and image but I was just thinking if it was possible to do it on a per server basis.
Maybe an if server ID matches... then use this image and this name.
I am not 100% if that makes sense but let me know!

It is possible but changing bot username and image is 1 time process. if you change bot username and image again and again then you will get a warning as well as an error by discord.
You can use it but username and image once changed will show the same as in 1 server for all servers.

Related

Time out, Image send, Email track adding to bot framework composer

I have developed a chatbot for IT Support team in our company, running on MS Teams using Bot Framework Composer. I have integrated it with Azure logic apps to send emails to IT Support team.
I want to know how to;
Get user's email address in MS Teams (We can get user's name using ${turn.activity.from.name} telemetry track event)
Set a timeout period
Send a Image to using HTTP request in JSON format (Then users can upload the screenshot of their issue)
Yes, you can get the user's email address in MS teams by making fetching the roster or user profile or make use of get single member detail from this documentation.
Not sure if you want to restart a conversation or track the last time a message was received from a user, but you can refer to Expire a conversation documentation to get started with.
MS Teams makes use of webhooks to integrate with external apps and makes use of Standard HTTP message exchange feature where responses appear in the same chain as the original request message and can include any bot framework message content, for example, rich text, images, cards, and emojis.

identifying a Skype user using the bot -c#

I'm building a Skype bot using Microsoft's framework and I want to recognize the users.
can anyone give suggestions on how to do it? The users should be recognized in order to give them authorization for tasks the bot preforms so it must be something that never changes and can be stored on a database.
The only thing I saw was "ServiceUrl".
thanks!
You can get the unique user id like below:
var userId = Context.Activity.From.Id;
This will always give you the user ID of the channel they reside on. In your case it will be their Skype ID.

BotFramework - No recording icon in Bot Emulator

Working on a voice bot that will take as input the voice, I have two concerns.
Technology(.net), Framework(BotFrameWork v4)
The Bot Emulator doesn't contain the recording icon, how to bring that. If by putting the microsoft app id and password, It shows up then where to get these credentials for local development and testing.
How to give the response input to the bot, v4 documentation is a way too confusing for me, I would like someone to tell me specifically what im looking for.
Thanks
You need to add your app id and password to the development endpoint in your bot file to enable the microphone feature on the emulator.
If your bot file has a production endpoint, you can likely find the app id and password there. Most bot files are encrypted, so I would recommend retrieving the id and password through the emulator. In the emulator, right click on production under the Endpoint section on the left and then select Edit Configuration. This should open a window where you can copy the app id and password.
If your bot file does not have a production endpoint and you don't have the app id and password stored somewhere else, you will have to follow this guide to register your bot on the Azure Portal.
Now that you have the app id and password for your bot, you need to add them to the development endpoint in your bot file. Once again, most bot files are encrypted, so open your bot in the BotFramework Emulator. Right click on development under the Endpoint section on the left, and select Edit Configuration. It will open a screen where you can add the Application id and password that we retrieved in the previous step.
Now run your bot and connect to it in the emulator. You should be able to use the microphone to talk to your bot. When the user talks to the bot, the emulator will convert the user's voice to text and will send the message to the bot as an activity like any other interaction the user has with the bot.

Grafana - Slack alert doesn't show images

Following on from the documentation and answers to similar questions here, I've created a Slack app with a bot user and connected it to my public channel in Slack. I've also invited the bot user and gave it files:write:user OAuth Scope. After all this, I reinstalled the app to apply the changes.
My configuration in Grafana has:
Include image ticked
The correct webhook URL from Slack
Recipient contains my channel name
My bot token
The Send Test works fine, even in private channels. I first receive a notification from the app and then a pretty image from the bot user. From the Javascript console, my Grafana version is 5.0.3. I've repeated this process several times with no luck. The only I can imagine is that I'm not an Admin but then I wouldn't have expected the test to work.
I've also looked through the Grafana log files and it seems to come from Grafana's side; specifically, it has trouble rendering the image.
lvl=info msg="New state change" logger=alerting.resultHandler alertId=1 newState=ok prev state=alerting
lvl=info msg=Rendering logger=png-renderer path="somepath?panelId=11111"
lvl=eror msg="failed to render an image" logger=png-renderer error="exit status 127"
lvl=info msg=uploaded logger=alerting.notifier url=
lvl=info msg="Executing slack notification" logger=alerting.notifier.slack ruleId=6 notification="myalert"
lvl=info msg="Uploading to slack via file.upload API" logger=alerting.notifier.slack
lvl=info msg="Request Completed" logger=context userId=1111 orgId=1111 uname= method=GET path=/ status=302 remote_addr=000.111.222.333 time_ms=0 size=29 referer=
Answering after long time, but I hope if this can be helpful to someone, To upload images on slack bot from Grafana, set files:write in Oauth and permission setting on app in slack setting(as stated in question than in particular channel invite your bot( try typing #botname it will automatically ask that invite bot to this channel)
The solution was to install missing fonts, specifically libfontconfig in Ubuntu, if you are using the tar.gz file rather than the deb file (for some reason, it doesn't include the fonts by default). As a note to future users of other distros, each one has their own requirements so be sure to check out the Grafana docs.

Get user location for bot framework

I am developing a bot using botframework in C# and I'll be using the web connector.
How can I get hold of my user location "gps coordinate" when needed?
Only some of the channels allow users to share their location (i.e. Telegram). In those cases, the bot needs to ask the user to share their location and then the user needs to take explicit action within the channel to share the location. When they do, this data will be sent back to the bot.

Resources