Reading a slack topic programmatically - jenkins

I am attempting to read a slack topic. At the moment when looking at the slack API methods, there is no mentioning of this.
My goal is that with the conversations.SetTopic method I am successfully able to add a topic onto the slack channel. However, I would like to find a way to read that topic programmatically so that my Jenkins automation script could adjust to it.
Is there a way where one could read the topic on a slack channel programmatically?

I was able to solve this, It wasn't clear at first as I kept looking for something similar to conversations.SetTopic.
Instead I found out that conversations.list does what I was thinking about which is to read the conversation topic and send it back to me.

Related

Subscribe to Jira search filter using jira Rest API

I have created a Jira search filter, using this request:
POST /rest/api/2/filter
This worked pretty well. Now after I created the filter, I want to get automatically subscribed to it.
Is there a way to do it with the REST API? Or is the only possible way to do this manually?
I already found this in the documentation: https://docs.atlassian.com/software/jira/docs/api/REST/7.4.1/#api/2/filter-createFilter
There, I found the "subscriptions" property, but I can't seem to figure out how exactly I have to write this, to get the correct syntax.
Thanks.
There is a JIRA Feature Request that is still being considered for this to be implemented. Please take a look at this for more details.
For now, all we can do is Fetch or Create Filters using the JIRA ReST APIs but editing the subscriptions should be manual tasks.
Please take a look at the following Atlassian Question which confirms the same.
Details as provided in this Question:
You can do a GET to see the filter subscriptions values you have via:
GET /rest/api/2/filter/favourite?expand=subscriptions
Hope this helps!

Delete channel in Slack API

I am finishing development of API similar to Slack API, but with more/different features. I have to implement an API (more like command/endpoint) for deleting a room and I can't find anything like that in the documentation.
It seems that it can be done via webUI according to this help article.
But there is no method for it in Slack API methods.
I think there is only channels.archive with similar purpose, but it seems very strange not having a method to delete a room.
Is it really like that that room can't be deleted via Slack API?
There is no method for deleting a channel in the official API, but there is the undocumented method channels.delete that has this exact functionality.
Basic usage is:
https://slack.com/api/channels.delete?token=TOKEN&channel=C12345678
Please note that undocumented methods are not officially supported by Slack and might change or stop working without any prior warning. Still, they are very useful and I have made a github to document all known undocumented methods. Please feel free to use and contribute.
Tried it today 2nd June 2022 and it responds with 'unknown_methods', I guess it's outdated now.

Trying to build a bot that listens for it's own name to be tagged

I've been playing with the reddit API and I'd really like to make a bot that listens for someone to tag it in a comment, and then responds with a comment.
I've been looking through the docs here but haven't found what I'm looking for.
I've seen other bots do this in the past so I feel it must be possible.
If someone could point me in the right direction I'd really appreciate it.
Cheers.
If you use PRAW (Python Reddit API Wrapper), then you can use the redditor.inbox class to track "mentions". http://praw.readthedocs.io/en/latest/code_overview/reddit/inbox.html?highlight=Mentions
Otherwise, AFAIK mentions are just another item in your inbox.
https://reddit.com/r/redditscripting

Viewing user responses from slack to errbot

I'm very new to bots. I'd like to develop a quick/simple test that makes it possible for a bot (errbot) to write a message to slack, then view responses back to the bot from users on slack.
How do I go about achieving this? Do I need to write a plugin for this?
Apologies if my question is too general/ambiguous -- I haven't come across an example that clearly explains this.
Yes, you need to program a bot a way or another, Errbot is just a framework that help you do that (concentrate on messages/responses) through plugins and not on the technicalities of the services it is connected to (Slack or any other).

Slack integration for alarms or alerts

I am new to Slack. I can't find any integrations for an "alarm clock"-type integration, as explained below.
What I'm looking for is a reminder to post to one of our Slack channels on a set schedule. For instance: each weekday at 9 AM, our #bug-fix channel gets a message like "do your bug fix XYZ thing."
I've searched Slack's integrations page but can't find anything that does this. Can anyone recommend an integration like this, or point me to a resource where I might be able to find one?
Many thanks in advance.
EDIT: I've found an IFTTT recipe that looks promising, which I'll share here in case any one else has this same question:
https://ifttt.com/recipes/177138-post-a-daily-reminder-to-a-slack-channel
However, I don't know the Slack integrations ecosystem well. Other suggestions would be appreciated.
Just type this in Slack:
/remind #bug-fix to do your bug fix XYZ thing. every weekday at 9am
Setting reminders in Slack
I am not sure if you are looking for a generalizable alarm clock with static messages, or something custom. You can use Incoming Web Hooks to write your own custom integration. Create a simple script that you schedule as a cron job to run at 9am. If it's a weekend, your script can exit, otherwise it can grab the data it needs to post (from whatever criteria you want in your bug tracking system, or wherever) and send it to your Slack channel. If you search GitHub for "slack webhook" you will find examples for every language of sending a message to Slack. They make it very easy to send messages to a channel.

Resources