I am the admin of a Slack team.
Is there a way that I can auto-invite a bot to all slack channels that are created in my team?
Yes, that is possible for public channels, but not for private channels.
You can subscribe to event types and use either the RTM API or the Event API to make your bot listen to those events and react accordingly.
The event channel_created will be triggered each time a new public channel is created.
Unfortunately there is no pendant (e.g. group_created) for private channels (called "groups" in the API). I am guessing this is for security reasons. Private channels can only be accessed by a user or bot that is invited, so even admins and owners can not access private channels on their Slack team, which there have not been invited to.
Related
I am looking for a solution where a team can contact a single user via chat.
Adding that user to the team and then removing could be a possible solution - but not that good. Also, if team A wants to connect person B and person C separately.
Microsoft Teams allows users to bring bots into their channel or group chat conversations. By adding a bot to a team or chat, all users of the conversation can take advantage of the bot functionality right in the conversation. You can also access Teams-specific functionality within your bot like querying team information and #mentioning users.
Chat in channels and group chats differ from personal chat in that the user needs to #mention the bot.
Please refer below doc:https://learn.microsoft.com/en-us/microsoftteams/platform/resources/bot-v3/bot-conversations/bots-conv-channel
I am trying to see if there is a way to configure an application in sendbird ( not the client app but the app configuration at sendbird ) to not allow users to create channels.
We are wanting to manage the users for a channel based on our own system's needs ( mostly around dynamic groups of users and it looks like sendbird does not support such a thing and only has user to channel relations )
By disabling channel creation for users we can write extra logic into our chat client to communicate with our own APIs for adding dynamic groups of users and we then send the requests from out platform to sendbird to add or remove users who belong to those groups for the desired channels or if the groups change on our side when people add and remove users then we can maintain a sync for sendbirds channels to ensure the correct users persist in the channels.
If my understanding is wrong and Sendbird does support dynamic groups then please advise and I will prefer this option else if someone knows how to configure an app for sendbird ( not the client app code but in the configuration of the app at sendbird ) to not allow channel creation by users.
Thanks.
In the SendBird SDK - Authenticated users have access to their own channels only. Furthermore, it is also possible to specifically restrict the create channel method at the individual user level. If you contact SendBird support (support#sendbird.com) they are able to help with this requirement.
Regarding dynamic groups. SendBird has group channels which can have their member lists controlled by SendBird's platform API. This seems to fit with your requirements. New users can be programmatically invited to, or removed from a group channel.
Using the Slack API (webhooks, RTM, Web, doesn't matter) is it possible to initiate a DM/Private channel with a user where the private IM channel doesn't already exist?
I am aware of the API call https://api.slack.com/methods/im.list which will show me the private IM channels that are already open, however this is an empty list for the bot as no real user will have DM'd the bot.
Basically, we have a list of users who need to be notified of something privately by a bot, and those users will not likely have DM'd the bot before, so the private channel will not yet exist. How can we create that channel using the API?
Well, the fool that I am just needed to RTFM.
https://api.slack.com/methods/im.open
This method opens a direct message channel with another member of your Slack team.
Arguments
This method has the URL https://slack.com/api/im.open and follows the Slack Web API calling conventions.
I am trying to make a bot that will listen to all public & private channels, and IMs for a team, and will reply when it sees certain trigger words. This will be a "Slack App", installable to your team using the "Add to Slack" button, and includes a "Bot User".
I have asked for the "bot" OAuth scope, and subscribed to the "message.channels,message.groups and message.im" Team Events (at https://api.slack.com/apps/myAppId/event-subscriptions) but do not appear to receive event POSTs through the Events API when new messages are sent.
Adding the "channels:history,groups:history,im:history" scopes makes the bot receive these event POSTs, but I believe only for the user that added the bot, so it will not watch groups that the adding-user was not a member of, or IMs between 2 other users. This means that behaviour will be different, depending on which user installed my bot.
Is there a way of installing the app/bot for an entire team? The documentation seems to indicate that a 'bot' scope should have the ability to receive events, but I am not seeing this (I require the channels:history scope etc. above).
bot - request this scope when your Slack app includes bot user functionality. Unlike incoming-webhook and commands, the bot scope grants your bot user access to a subset of Web API methods, the RTM API, and certain event types in the Events API.
(from https://api.slack.com/docs/oauth-scopes)
The page on bots also claims that a bot can receive all messages through the RTM API:
This websocket will send you all of the messages and activity that happen in public and private channels that the bot user is invited to, as well as messages that are sent to it via direct message. A bot user opens this websocket with the RTM API by sending an authenticated call to the rtm.start API method. To learn more about connecting to the RTM API, read the documentation here.
(from https://api.slack.com/bot-users)
Is this same behaviour possible in the events API without needing to use the RTM API or add those additional scopes mentioned above?
I see from your comment that you have understood that the bot scope (and the channels.message Events subscription) allows your bot to receive from channels it is present in.
You have two options
1) you ask for channel.write scope in addition to bot, and you invite the bot in all channels (using the user token, not the bot token)
2) you work on your onboarding and figure out a way to get your "champion", ie the user who installed your app, to invite your bot in relevant channel.
Keep in mind that solution 1) is usually seen as very intrusive, especially in large teams where most people haven't heard of your app nor taken the decision to install it. But it can be suitable for some very specific use cases. Option 2) is the recommended route, but it is hard :-) Good luck!
The channel.join api in the slack web api does not have a slack userid field. The problem is since there are lot of channels in our slack team user gets confused on which channels to join. So we have segregated channels based on internal teams. And if an user selects his team he should be able to auto-join all the channels which are related to him.
As an admin of the slack team is it possible to add other users to different slack channels using Slack API?
You can use the Slack API method channel.invite to invite users to any slack public slack channel. It allows you to specify the channel and user by ID.
See here for the documentation.