:mega: :x: Slack integration that can destroy all incoming messages from Slackbot.
This bot deletes auto responses from Slack's very own Slackbot. If you'd like to be rid of the responses in certain channels in your organization, you can employ the Slackbot Destroyer
to fight on your behalf.
Note that in order to delete Slackbot's messages, this bot must be installed by a user who has permission to delete Slackbot messages in Slack. Slackbot's messages will be deleted using the permissions of the user that installs Slackbot Destroyer.
BOT_ID
. You can obtain this by running:export BOT_NAME=$bot_username_from_bot_user_step
pipenv run python id.py
If you'd like to run the application manually you can add the required secrets within constants.py as environment variables and then run $ python app.py
.
The installation button will require you to enter a number of API keys. Below you'll find an explanation
Key | Value Information | Required |
---|---|---|
BOT_ID |
The ID of your Slack bot user, this is required so the bot knows when a command is directed at it. You can obtain this ID through the steps described in the Installation process. | Yes |
SLACK_BOT_TOKEN |
The bot token found within the Slack API settings. | Yes |
SLACK_USER_TOKEN |
The user token found within the Slack API settings. This must be the user token of an admin. | Yes |
AWS_ACCESS_KEY_ID |
Your AWS access key id, only required if you'd like to persist the bot settings. | No |
AWS_SECRET_ACCESS_KEY |
Your AWS access key id, only required if you'd like to persist the bot settings. | No |
AWS_BUCKET_NAME |
The name of your S3 bucket on AWS, only required if you'd like to persist the bot settings. | No |
CHANNEL_WHITELIST |
A comma seperated list of channels you'd like the bot to operate in, if this is left blank the bot will be allowed to join any channel. Requires channels:write and channels:read permissions. For example general, random . |
No |
Heroku has no ability to do persistent storage, and will periodically reboot your dynos, causing your bot to lose its state. We have a simple data persistence option using an S3 bucket on AWS. Here are steps on AWS to configure persistent storage.
AWS_BUCKET_NAME
environment variable in your Heroku settings.{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::{bucket-name-on-s3}"
]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::{bucket-name-on-s3}/*"
]
}
]
}
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
environment variables in Heroku. Click 'Close' when you're finished.heroku logs
on the command line to check that everything is initialized correctly.The following commands are available.
# Displays a list of available commands.
@slackbot-destroyer commands
# Activate Slackbot Destroyer in a channel.
@slackbot-destroyer destroy
# Deactivate Slackbot Destroyer in a channel.
@slackbot-destroyer deactivate
# Show how many times Slackbot Destroyer has destroyed Slackbot responses.
@slackbot-destroyer stats
# Teleport to the future
@slackbot-destroyer teleport
# Make Slackbot Destroyer moderate the frequency of Slackbot responses.
@slackbot-destroyer moderate
# Ask Slackbot Destroyer what it is doing in the current channel.
@slackbot-destroyer wassup
# Ask Slackbot Destroyer what Slackbot responses it has seen so far.
@slackbot-destroyer track
# Change the frequency of a Slackbot response (1 will always show the response and 0.1 will show it 10% of the time).
@slackbot-destroyer hunt [index from track command] [new frequency]
Want to mod a bot? You can develop SLACKBOT DESTROYER on OSX via the following steps: