print msg in chat when poked

This commit is contained in:
Niklas 2020-09-06 13:44:13 +02:00
parent 50753f8b44
commit 3947cfcce2

View File

@ -1,5 +1,10 @@
package tsgo package tsgo
import (
"fmt"
"time"
)
type AnyId uint16 type AnyId uint16
type PluginMessageTarget int type PluginMessageTarget int
@ -39,6 +44,16 @@ func Ts3pluginShutdown() {
// Ts3onClientPokeEvent event // Ts3onClientPokeEvent event
func Ts3onClientPokeEvent(serverConnectionHandlerID uint64, fromClientID AnyId, pokerName string, pokerUniqueIdentity string, message string, ffIgnored int) int { func Ts3onClientPokeEvent(serverConnectionHandlerID uint64, fromClientID AnyId, pokerName string, pokerUniqueIdentity string, message string, ffIgnored int) int {
Ts3Functions.PrintMessage(serverConnectionHandlerID, "Ayy", PLUGIN_MESSAGE_TARGET_SERVER)
// TODO add correct color and icon
msg := fmt.Sprintf("[color=blue]<%s> [URL=client://%d/%s]\"%s\"[/URL] pokes you", time.Now().Format("15:04:05"), fromClientID, pokerUniqueIdentity, pokerName)
if message != "" {
msg += ": " + message
}
msg += "[/color]"
Ts3Functions.PrintMessage(serverConnectionHandlerID, msg, PLUGIN_MESSAGE_TARGET_SERVER)
return 1 return 1
} }