Like we have slash commands in slack, which helps us to perform get or post
similar to do that do we have anything in Microsoft team and if yes are there any documentations.
I have built some slash commands using pythong in slack but i am not finding anything for teams.
In essence, Teams doesn't provide a 100% direct match to "/slash" commands, but there are equivalents, and they pretty much all involve the use of a Bot. In practice, it really just means going from "/" to "#", as you #mention the bot to invoke it, and it can proceed as needed from there.
That said, there are a few places where you might want to surface this. For instance, the "normal" place is in a chat inside a channel. To make this work, you -can- get away without a Bot, but a Bot is the easiest. If you want to do something outside a channel, like just invoking the bot directly, there are two options - interact with the bot in a 1-1 style (in which case the bot appears in the "chat" left menu, as if it were another user). In this case, incidentally, you don't "#mention" the bot because it's the only other person in the chat. The other option is the command text block right at the top of the screen in Teams. In this case, you can have the bot open UI to send it parameters in a guided form, even.
So, in short, there are similar options to "slash" commands in Teams, but for the most part they involve Bots, so you should look into that more. In particular, look at the Teams development docs for Bots, Message Extensions, and Task Modules.
I suggest you also have a look at Create a bot with the Bot Framework SDK for Python.
You could Add custom bots to Microsoft Teams with outgoing webhooks. A webhook is essentially a POST request sent to a callback URL.
Related
I am trying to make a WhatsApp bot inspired by the functioning of Discord bots, the bot will work in WhatsApp groups.
I have looked up the official WhatsApp Business API but I am not sure that they will not approve my number as it is just a hobby project and not a proper "business".
There is an alternative though and that is the Twilio WhatsApp API. However, they provide you with a sandbox. I can interact with it in DMs but as the sandbox number is a business account, I cannot add it to a group like discord.
I intend to write a server in python or node.
Can anyone share a solution or workaround? Only if I could add the Twilio number to a group my problem will be solved. Though I am ready to use any other API/Solutions for this.
There is actually a Python solution for this. It is a pain to set it up, but it still works. Check it out:
https://github.com/mukulhase/WebWhatsapp-Wrapper
It uses the webdriver Selenium to send/retrieve messages through Web-WhatsApp.
Be aware that it is against their rules, so your phone number might get banned!
I have some python scripts which perform some jobs based on the user inputs I want to host this on microsoft teams. For an outgoing webhook teams asks for a https link where and how do I get it. I am pretty new to this so do not take anything for granted.
Basically, this "outgoing webhook" means that Teams has the ability to call a web service of some sort, hosted on a publicly-accessible https address. In the end, it functions very similarly to a bot, so it's possible to just create a full-blown bot. Here's guidance on creating a Microsoft bot (for Teams or otherwise) using Python.
However, there's a more simple option, of basically just hosting a web function somewhere (e.g. an Azure Function or, I guess, an Amazon Lamba). See this article. As mentioned in this link:
Outgoing webhooks post data from Teams to any chosen service capable
of accepting a JSON payload. Once an outgoing webhook is added to a
team, it acts like bot, listening in channels for messages using
#mention, sending notifications to external web services, and
responding with rich messages that can include cards and images.
An Azure Function automatically gets a full, unique, https address, so it's fine to use.
As another example, this blog post describes how to create a Flow ("Power Automate") that the webhook calls into. This example also ends up using an Azure Function to "glue together" Teams + Flow, but it explains the concepts a bit. You could ignore Flow and just use an Azure Function.
Whether to build an -actual- bot depends on -what else- you might want to be able to do. For instance, do you want to have a more complete conversation with the user? Do you want to the user to be able to interact with your code outside of a channel (e.g. a 1-1 conversation)? These are the kinds of things that will indicate if you might need a proper bot.
You need to use bot framework to create bot that will handle that:
https://github.com/microsoft/botframework-sdk
https://github.com/microsoft/BotBuilder-Samples
Slack API provides you two options: use app as a bot and as a logged in user itself. I want to create App that will be working as a user and run channel commands. How can I do with discord.py?
Discord.py is no longer maintained to work on user accounts, so given the recent updates in the user api, it is no longer the ideal framework which selfbots should be written in.
There are a number of selfbot api libs out there, but the best one that's written in python is this: https://github.com/Merubokkusu/Discord-S.C.U.M
P.S. selfbotting against tos - so be careful (respect rate limits and don't act like a bot)
As Wright has commented, this is against discord's ToS. If you get caught using a selfbot, your account will be banned. However, if you still REALLY want to do this, what you need to do is add/replace bot.run('email', 'password') to the bottom of your bot, or client.run('email', 'password') to the bottom depending on how your bot is programmed.
Lately, I've worked on a chat bot of my own for twitch.tv, connecting using the IRC channel and using a python script as well as logs from HexChat, my IRC client, to build my bot, which currently can give(upon query) the uptime of the channel, and statistics on emotes in the channel.
However, I have seen Moobot and Nightbot, 2 of the most popular chat bots on twitch, and was wondering how I could:
1) Turn this python script into something a streamer can authorize to be on their channel,
2) Hook up a GUI to this, or a series of text fields for the user to input their settings for the bot while it runs on their channel.
I have looked at previous questions on StackOverflow, looked on Google, and asked in the #twitch-api IRC channel on freenode, however none of these provided the answer, and the only bots I have seen that have this channel-bot integration and authorization are Moobot and Nightbot. Upon clicking "connect to twitch" on moobot's homepage, I can authorize it to use my account much like an oauth request, however I do not know how to set this up. I hope this will help others like me wanting to add some extra usability to their WIP Twitch Chat bot. Thanks!
Moobot: http://twitch.moobot.tv/
Nightbot: https://www.nightbot.tv/
Most of the "big" server-hosted bots consist of 4 major parts:
A database (SQL or NoSQL) holding all the settings etc.
A REST (or similar) API that is used to communicate between the individual parts
A web application for the frontend
A standalone bot for the backend
Keep in mind that this is alot of work to set up. I am currently working on a full rewrite of my bot, which I would share if it wasnt in a pre-alpha state.
Keep in mind that setting up these individual parts might require an experienced web developer. Here is some tips however:
Using python, Django is a great decision for a web application + API backend
As far as I know, there is no decent IRC library for python supporting IRC v3 so you might have to implement your own. Sample implementation of the message parser
Apart from that, see the Twitch.tv API documentation - this includes the Authentification workflow.
If you are looking for a locally-hosted bot, that's a completely different thing to deal with. There is a fair amount of those, some of which are open source too. I dont know any low-level ones, but maybe looking at Botnak, made by a friend of mine, answers some questions.
I'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good functionalities that are usually included in the bots? Thanks for your ideas.
Unless it's solely for the educational experience, you should really just use a framework for the core functionality.
That said, here's some of the things the bot in my home IRC channel does:
Choose one item from a list of options
Display a random entry from the Linux fortunes file
Display a random set of words from the Emacs spook file
Check every line from a user and display a quote from The Big Lebowski if it's sufficiently similar (this is probably a bit my-channel specific :) )
Check if a link has been mentioned before and say who/when (we all read the same RSS feeds and tend to duplicate links a lot)
Conduct a poll
Pull a given quote from our internal QDB
Check if a given link has been posted to Reddit, and give the corresponding Reddit thread link if so. If a Reddit link is posted, give the direct link instead
Track the last time a given nick was in the channel, and the last time they spoke
Queue a message for an offline nick that's automatically sent in-channel when they join
Use Google Translate to translate a given phrase
Post a given line to our channel's Twitter feed
Choose a random user and kick them (not the best idea depending on how unruly your channel is)
Pull the summary of a given term from Wikipedia and display it along with a link to the full article
Display information about any posted Youtube link (video title, length, submitter, votes, comments, etc.)
I'm also in the process of writing a bot in node.js. Here are some of my goals/functions:
map '#' command so the bot detects the last URI in message history and uses the w3 html validation service
setup a trivia game by invoking !ask, asks a question with 3 hints, have the ability to load custom questions based on category
get the weather with weather [zip/name]
hook up jseval command to evaluate javascript, same for python and perl and haskell
seen command that reports the last time the bot has "seen" a person online
translate command to translate X language string to Y language string
map dict to a dictionary service
map wik to wiki service
Again, this is an utterly personal suggestion, but I would really like to see eggdrop rewritten in Python.
Such a project could use Twisted to provide the base IRC interaction, but would then need to support add-on scripts.
This would be great for allowing easy IRC bot functionality to be built upon using python, instead of TCL, scripts.
That is very subjective and totally depends upon where the bot will be used. I'm sure others will have nice suggestions. But whatever you do, please do not query users arbitrarily. And do not spam the main chat periodically.
Make a google search to get a library that implements IRC protocol for you. That way you only need to add the features, those are already something enough to bother you.
Common functions:
Conduct a search from a wiki or google
Notify people on project/issue updates
Leave a message
Toy for spamming the channel
Pick a topic
Categorize messages
Search from channel logs