Skip to content

Instantly share code, notes, and snippets.

@NotSoSuper
Last active August 4, 2021 04:00
Show Gist options
  • Save NotSoSuper/fced730f9d0bd4cafdb6c131d9ba2f8e to your computer and use it in GitHub Desktop.
Save NotSoSuper/fced730f9d0bd4cafdb6c131d9ba2f8e to your computer and use it in GitHub Desktop.
local function getMyself(serverConnectionHandlerID)
-- Get Self ID
local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
if error ~= ts3errors.ERROR_ok then
print("Error getting own client ID: " .. error)
return
end
if myClientID == 0 then
ts3.printMessageToCurrentTab("Not connected")
return
end
-- Get which channel we are in
local myChannelID, error = ts3.getChannelOfClient(serverConnectionHandlerID, myClientID)
if error ~= ts3errors.ERROR_ok then
print("Error getting own channel: " .. error)
return
end
local clients, error = ts3.getClientList(serverConnectionHandlerID)
if error == ts3errors.ERROR_not_connected then
ts3.printMessageToCurrentTab("Not connected")
return
elseif error ~= ts3errors.ERROR_ok then
print("Error getting client list: " .. error)
return
end
return myClientID, myChannelID, clients
end
function PokeMods(serverConnectionHandlerID, ...)
local myClientID, myChannelID, clients = getMyself(serverConnectionHandlerID)
local clients, error = ts3.getClientList(serverConnectionHandlerID)
for i=1, #clients do
local c = clients[i]
if c ~= myClientID then
local groups, error = ts3.getClientVariableAsString(serverConnectionHandlerID, c, 34)
if error ~= ts3errors.ERROR_ok then
ts3.printMessageToCurrentTab("Error getting client groups: " .. error)
return
end
local ranks = {["23"] = true, ["22"] = true, ["34"] = true}
for group in string.gmatch(groups, '([^,]+)') do
if ranks[group] then
ts3.requestClientPoke(serverConnectionHandlerID, c, table.concat({...}, " "))
end
end
end
end
end
@Thtk
Copy link

Thtk commented Aug 4, 2021

ts3.requestClientPoke(serverConnectionHandlerID, c, table.concat({...}, " "))

When i use this function at TS3, the lenght of poke is limited and small. how can i make it bigger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment