Maintaining a cache of huge slack workspace - caching

I need to implement Slack user/channel suggestions dropdown to share something using the user's Slack token. And (AFAIK) Slack doesn't provide any search-by-name features, so the only way is to implement it ourselves.
Currently, I'm thinking of pushing all public channels (most likely, I will have to figure out how to do the same for private ones) and users' data into something like Elastic. And use Slack Events to keep it up-to-date.
Are there any best practices for this task? I'm pretty sure it's a more or less a trivial problem, and I'm not the first one who needs to implement such a solution - but surprisingly enough, I didn't find any off-shelf solutions to this problem

Have you considered using Slack's Block Kit feature? It offers both a conversations-select and a users-select dropdown menu that you can embed into messages.
https://api.slack.com/reference/block-kit/block-elements#select

Related

Is it possible to Fetch Real-time data using Riot Valorant Api?

I am making an application that shows real-time status for a Valorant game. like players alive, the type of weapons each play has, time remaining, etc.
Is it possible to use Riot Valorant API to do this for live matches or for previously played matches?
As per my knowledge you couldn't. But I think you should try with Riot Games' official production API, not development API.
Let me know if you find something relatable.
(This is adding onto Sanskar's answer, which I cannot comment on as I lack the required 'reputation')
I'm aware that this is an old question, but for anyone who happens to have stumbled upon this question, there is no way to obtain real-time in-game events however, there is a way to retrieve certain data from a match-- only except, not in an official way that does go against Riot Game's TOS of using third party software. Though, I wouldn't worry about this too much as long as you do not ruin the competitive integrity of the game by providing yourself with an in-game advantage over others in the game. I personally have been using this for over a year now and have not received any form of punishment for doing so.
Anyhow, back to the actual question of this thread, check out this document of API endpoints that have been scraped through monitoring HTTP traffic of the Riot Client. https://github.com/techchrism/valorant-api-docs/tree/trunk/docs/ You'll need to obtain certain authorization tokens of the Valorant account through whatever methods are available to you (I pray that it is through lawful means :) ), which highly depends on the type of endpoint. There are certain wrappers for these endpoints already made by other users somewhere on GitHub, and you can always ask for help in the small community of developers that are using these endpoints in the README of the GitHub page I sent in this post.
REMEMBER TO NOT DO ANYTHING THAT WOULD CREATE AN UNFAIR ADVANTAGE, OR ANYTHING ELSE THAT A RIOT EMPLOYEE WOULD NOT APPROVE OF USING THIS :)

Get Slack channel where app is integrated

I might be missing something really simple but don't seem to find the solution.
I have created a quick and simple app which is meant to do some processing every morning and then send some logs to Slack.
I have been perfectly able to do so using Incoming Webhooks. Cool. The "problem" is that it requires me to set it up from the app settings (aka it obviously makes me define a specific channel for the Webhook so I can have the specific URL) and that's something I like a bit less.
I thought it'd be easier if I can just add/integrate the app on a channel using the Slack UI so I don't have to worry about having to know beforehand the channel(s) ID where the message has to go to and also any other user would be able to integrate in any other channel they consider.
I have integrated it on my testing channel (all good) and tested chat.postMessage (all good) but it still needs the channel (obviously). However, using conversations.list lists ALL channels and that's the opposite of what I'm looking for.
I need a way of getting just those channels where the app is integrated so I can post the message to those and only those.
Is this something that Slack doesn't allow or I'm just missing something very obvious here?
I hope it makes sense and someone can shed some light on this :)
You can use users.conversations method to get list conversations the calling user/bot may access.
https://api.slack.com/methods/users.conversations
Use Bot token to call the API.
Use type argument to search public, private, mpim & im conversations
https://api.slack.com/methods/users.conversations#arg_types
Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im

Microsoft Teams: Is at all possible to create a app/connector/bot for broadcasting?

Trying to parse through the Microsoft Documentation of this is a bit of a challenge.
Our use case is that we want the app to receive broadcasts from an external service. On that broadcast we want it to send a personalized message to every person in the team/org.
Is that at all possible? Doing this in Workplace and Slack was fairly straight forward but i'm going nowhere fast with Teams. Connectors seem weird and user-based, not team based, requiring you to set up a config page for it? Bots seem centered around AI interactions and on demand features and general apps? Not sure.
So yea the question is, is it possible. If so i would appreciate to know where to look for how to do this.
Yes, this is definitely possible. If you're wanting to send to a Team (i.e. a Channel within a Team) you can use either a bot or a webhook. If you want to send to individuals or to group chats, then you'd be looking to use a bot.
For webhooks, see Post external requests to Teams with incoming webhooks. For bots you can start here, and in that case you'd want to look into something called "Pro-active messaging", where the bot is sending a message on it's own, rather in response to a user's initial message.
The Pro-active messaging can be a bit tricky, so if you do want to go that approach (1 to 1 messaging), let me know in the comments and I give you some more guidance. However, I'd suggest rather looking at messaging the Team, and creating/using a relevant channel, rather than sending every user a 1-1 message.

MS teams: Easy way to get team/chat members?

Is there any way to get the team members in a tab scope using the SDK? I know you can get them by using Graph API, it's just that I wonder if there's a faster way to get them. It would be very useful to apply some context to the info displayed on the tab.
And I've got the same question for groupchat scope. In fact, I can see a method called getChatMembers, but it's not working nor visible at the docs, so I suppose it's not deployed yet.
Nevertheless, in docs I can read:
Because a malicious party run your content in a browser, this value
should be used only as a hint as to who the members are and never as
proof of membership
This kind of advise appears on several fields, so I suppose that using Graph API is safer.
In Tab Context you can get teamId, teamName, channelId etc. In order to get members in Tab you can use /members Graph API. For Bot you can get the team roaster in bot context.
getChatMembers is not yet available for 3P apps. We are working on it.

Slack API : Ability to view all recently added users to Slack Channel

I am working on a POC to proof out the ability to get a list of all the new users who have been added to a specific Slack Channel. From my initial review of the Slack API I am not seeing anything that showcases this ability, I was curious to see if anyone had worked on something similar or could point me to resources that would be a viable solution.
I believe there is no ready-made API method available, that will give you that specific information. However, Slack is very flexible and you can use the existing building blocks to easily add additional features as needed.
E.g. To get the requested information you can develop a small Slack app that listens to the member_joined_channel and member_left_channel events to keep track of when members joined a channel.
If you need a historical record of membership in a channel, you could use the Slack API's groups.history method, page through results, and build a membership log by looking for events of type member_joined_channel and member_left_channel through time.

Resources