Slack
Slack
Link your server to Slack!
Features
- Send chat messages and commands to Slack
- Send login and quit messages to Slack
- Uses minecraft username and avatar as bot information
- Blacklist players or commands from being sent to Slack
- Use permissions to block messages to Slack
- API to send custom events
- BungeeCord support (partial)
- See the console (coming soon)
- Formatting (coming soon)
- Send commands from Slack (coming soon)
Download
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
Installation
- Drop the plugin in your server folder.
- Create a new incoming webhook and set it up however you would like.
- Start and stop the server.
- Copy the webhook URL and set webhook: in the config.yml to that.
- Start the server.
Verified compatible with CraftBukkit, Spigot, Spigot/CraftBukkit 1.8, and Glowstone. Probably works with any Bukkit API server.
Commands
/slack - reloads the config
permission: slack.reload
Configuration
version - the plugin's current version. Do not touch this.
debug - whether to post HTTP response codes to console
webhook - the incoming webhook URL for slack.
use-perms - whether to use permissions or not (for sending to Slack)
use-blacklist - whether to use the command blacklist or not
blacklist - list of commands you don't want to be sent to slack.
Permissions
slack.hide.command - does not post commands you do to Slack.
default: no one
slack.reload - allows you to reload the plugin's config using the command /slack
default: op
slack.hide.login - does not post to Slack when you login.
default: no one
slack.hide.logout - does not post to Slack when you login.
default: no one
slack.hide.chat - does not post your chats to Slack.
default: no one
Custom Events
On the server, you may use
/slack send
to send a custom message to Slack.
Programmatically, you can add the plugin as a dependency, and then import the API for the platform you're using (either Bukkit or BungeeCord)
import us.circuitsoft.slack.api.BukkitPoster
or
import us.circuitsoft.slack.api.BungeePoster
If you're using Bukkit,
new BukkitPoster(m, p, i).runTaskAsynchronously(this);
where m is the message, p is the username, and i is the image URL. You can set i to null if p is a Minecraft player username.
If you're using BungeeCord, make a thread with the task BungeePoster. Same parameters as Bukkit.
Support
For support questions on how to use the plugin and troubleshooting, post a comment so if I am not available, other people can help you. Explain your problem and use the latest version before asking for help.
For bug reports, please post an issue on Github. Just make sure to explain the problem, how to reproduce it, and make sure you are using the latest version.
If you get an error, please post it to https://gist.github.com/ and then post the URL here.
If you have a feature request, PM me, or code it yourself and pull request it on Github.
1.4.0 will be released today! It will include an API, send command, BungeeCord support, and modularity!
1.5.0 will be released next week! It will include formatting, and remote console! (and anything else you guys want!)
@Grant1204
But slack is supposed to show commands. It acts as a server log.
@CircuitSoft
The actual effect command '!' does not show up in Minecraft chat normally. It acts like the '/' except it allows for calling minecraft effects directly. Shows up in Slack, doesn't show up in chat (unless you don't have permissions).
@Grant1204
Why shouldn't it show up in Slack? Isn't the user performing an action?
@CircuitSoft
Skript effect commands aren't really commands, they start with an exclamation mark, but no forward slash.
I would type
!send "Hello World!"
in chat, and it would show up in Slack as a chat message, where it shouldn't really.
@Grant1204
It is already using the monitor priority. https://github.com/CircuitSoftGroup/SlackMC/blob/master/src/main/java/us/circuitsoft/slack/Slack.java#L40
I will have to inspect how pwnfilter modifies messages.
Is that Skript thing a command or a chat message? You can blacklist commands using the config.
I will add an option to check if a message is cancelled. The reason why it shouldn't be enabled by default is because griefing/hacked plugins cancel messages like ?opmepls and the Slack plugin can help find these messages. Also, listening to PMs may be a plus to many server admins because some PM plugins do not have a /socialspy option.
@CircuitSoft
Sorry, I had the Bukkit priorities backwards. It confuses me sometimes how priorities work in Bukkit. I believe Monitor priority is best, since the plugin should not change the outcome of chat, and output the final product to Slack.
Some of the conflicts I have found with the priority of the Slack plugin that should be fixed in Monitor (maybe even highest) priority.
PwnFilter - Slack plugin sends unfiltered chat.
Skript - Effect command ('!<effect>') shows up in Slack
Herochat - PMs show up in Slack (I wrote a script that would normally fix this by cancelling the message and resending as a command, but Slack sends the message first)
@Grant1204
It is at the lowest possible priority.
I've found that the plugin has too high of a priority for sending messages. It usually sends chat messages to slack before they go through chat/spelling filters, and other plugins that modify/block specific messages.
I would like it if it sent the next to final message (very low priority), after all the other plugins finish their transformations, so that it shows the most accurate chat.
@Grant1204
I can add an option for formatting.
The reason why I added the player name prefix was because for mobile Slack notifications, it does not show the name of the person who posted the message. The reason why I added the quotes was because someone can just say logged out and you would think they logged out. But I guess I can add an option for the player name prefix and the quotes.
I did not intend for there to be a colon for the join and quit messages, I messed that up, and I will fix it.
It's fine, you're not being picky, I appreciate your suggestions!
It's not too important, but I'm not a fan of the formatting.
Maybe add a way to disable the player's name and the quotation marks in the message sent to Slack.
Matmorcat: "Hello World!"
to
Hello World
This is because the name is already listed above the message, the quotations aren't really neccesary, and the push notifications in Chrome Show up as ' Matmorcat: Matmorcat: "Hello World!" ' and ' Matmorcat: Matmorcat: logged in ' (maybe remove the ':' for join/quit messages).
Sorry for being so picky. :\
@Grant1204
Formatting codes are being worked on.
Yes, there are plans to submit commands and chats to the server.
And yes, an API is being worked on for that purpose.
(my planned features are listed in the features list)
Bug: Chat with non-UTF characters (color-codes) is ignored. Is it possible that the non-UTF characters are removed instead of the entire message being ignored?
Also, is there any plans for having a way to submit chat to the server with a custom format (plain text) or commands.
Like for example if I type "Hello World!" in Slack, I can configure the plugin to type in chat "[G] matmorcat: Hello World!" or send a console command with the sender's name and message as a variable, so that I can do some magic with Skript. {name} = sender's name, {message} = sent message from Slack
@jflory7
Awesome, thanks!
Incredible, this is brilliant! I will have to add this to my server this week. Thanks for making this!
@ArSkHelios
Thanks!
Glad to see somebody finally integrated these two. Good work.