-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command to receive discord invitation link
- Use /discord to receive discord invitation link in the ingame chat - Link must be set up in the config.yml - Whole command can be disabled in the config.yml
- Loading branch information
Showing
4 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package commands; | ||
|
||
import com.falyrion.discordbridge.DiscordBridgeMain; | ||
import net.md_5.bungee.api.chat.ClickEvent; | ||
import net.md_5.bungee.api.chat.TextComponent; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
public class Cmd_DiscordLink implements CommandExecutor { | ||
|
||
@Override | ||
public boolean onCommand(CommandSender commandSender, Command command, String commandLabel, String[] arguments) { | ||
|
||
if (commandSender instanceof Player) { | ||
Player player = (Player) commandSender; | ||
TextComponent textComponentDiscordLink = new TextComponent(DiscordBridgeMain.getInstance().discordInfoMsg); | ||
textComponentDiscordLink.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, DiscordBridgeMain.getInstance().discordLink)); | ||
commandSender.spigot().sendMessage(textComponentDiscordLink); | ||
} | ||
|
||
return true; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
name: DiscordBridge | ||
author: Falyrion | ||
description: DiscordBridge | ||
version: 1.0.2.0 | ||
version: 1.1.0.0 | ||
api-version: 1.17 | ||
|
||
main: com.falyrion.discordbridge.DiscordBridgeMain | ||
|
||
commands: | ||
discord: | ||
usage: /discord | ||
description: Shows the player a clickable link to a discord server in the chat | ||
permission: discordbridge.getlink |