JavaScript _ Template _ Kicklet
JavaScript _ Template _ Kicklet
Kicklet.app
SearchK
Main Navigation HomeDocumentation
Appearance
Menu
On this page
Sidebar Navigation
Documentation
Introduction
Default Commands
JavaScript / Template
Example Commands
On this page
• Sender
• Watchtime
• Follow age
• Followers
• Subscriber
• Channel
• Channel User
• Username
• Slug
• Viewers
• Title
• Category
• Uptime
• Active Chatters Count
• Active Chatter Random
• Active Chatter Random
• Counter: Get
• Counter: Set
• Counter: Add
• Points: Get
• Points: Set
• Points: Add
• Points: Remove
• Points: Add For All Active Chatters
• Random Number
• Random Item
• Random Item (Percentage)
• Named
• Argument Retrieval
• Arguments as URL query
• Time
• Formatted Time
• Case Conversion: Upper
• Case Conversion: Lower
• Minecraft Players
• Command List: All
• Command List: Permission
• Check Permissions
• Fetch JSON
• Fetch JSON with Headers
• Fetch Text
• Fetch Text with Headers
• Calculate: Add
• Calculate: Summing
• Calculate: Subtracting
• Calculate: Multiplying
• Calculate: Dividing
• Calculate: Modulo
• Parse: Int
• Parse: Float
• Check if a variable is a number
• Define a variable
• Override a variable in a scope
• Use a variable
• Define
• Define with arguments
• If statement
• If-Else Statement
• If-Else If Statement
• Get specific element of an array
• Get elements of all command args as String
• Create a command
• Edit a command
• Activate/deactivate a command
• Activate/deactivate a command group
• Binary Comparison Operators
• Send Discord Webhooks
• Console Logging
• Comments
• Get Currency Name
• Get Messages Count
• Command Execution Amount
• Specific Command Execution Amount
• Command Execution Ranking
• Current Song
• Clear Song requests
• Skip Song
• Request a Song
• Set Global Variable
• Get Global Variable
• Delete Global Variable
• Set Viewer Variable
• Get Viewer Variable
• Delete Viewer Variable
• Clear Viewer Variables
• Play Gif
• Play Sound
• Play Sound and Gif
• Custom Event
• Set Auto Title
• Set Auto Title Active
• Timeout
• Ban
• Clear Chat
• Ban All
• Ban All with Excluded Roles
• Ban All with Similarity Threshold
• Ban All with Similarity Threshold and Excluded Roles
• Timeout All
• Timeout All with Excluded Roles
• Timeout All with Similarity Threshold
• Timeout All with Similarity Threshold and Excluded Roles
• Text-to-Speech (TTS) with Specified Voice
JavaScript / Template
You can enhance your own Kicklet commands with simple template variables, or even build
your own logic using the template language or JavaScript.
Sender
Example (Template):
go
Welcome to my stream, {{sender}}!
Example (JavaScript):
js
const sender = $event.getSender();
Watchtime
• Returns the watch-time of a user.
Example (Template):
go
Your watchtime: {{kicklet.Watchtime sender.String}}
The watchtime of exampleUser is: {{kicklet.Watchtime "exampleUser"}}
Example (JavaScript):
js
const watchtime = Kicklet.watchtime('userName')
.then(resp => resp.data.watchtime);
Follow age
• Returns the time a user is following the channel.
Example (Template):
go
You are following since: {{kick.FollowAge sender.String}}
Example (JavaScript):
js
const sender = $event.getSender();
const followAge = Kick.getChannelUser(sender)
.then(resp => resp.following_since);
Followers
• Returns the number of followers the streamer has.
Example (Template):
go
The streamer has {{kick.Followers}} Followers.
Example (JavaScript):
js
const followersCount = Kick.getChannel()
.then(resp => resp.followers_count);
Subscriber
• Returns the number of subscriber the streamer has in the last days.
Parameters
• days (Number): Specifies the time frame, in days, for which subscriptions should be
counted. For example, counting subscriptions from the last 30 days.
Example (Template):
go
The streamer has {{kicklet.SubCount 30}} Subscriber.
Example (JavaScript):
js
const followersCount = Kicklet.subCount(30)
.then(resp => resp.data.count);
Channel
• Returns the Kick channel of the streamer.
Example (Template):
Example (JavaScript):
js
const streamerChannel = await Kick.getChannel()
.then(resp => resp);
Channel User
• Returns the Kick channel of requested user.
Example (Template):
Example (JavaScript):
js
const userChannel = Kick.getChannelUser('userName')
.then(resp => resp);
Username
• Returns the Kick username of the streamer.
Example (Template):
go
The streamers username is: {{kick.Username}}
Example (JavaScript):
js
const userName = Kick.getUsername()
.then(resp => resp);
Slug
• Returns the Kick slug of the streamer.
Example (Template):
go
The streamers slug is: {{kick.Slug}}
Example (JavaScript):
js
const userName = Kick.getSlug()
.then(resp => resp);
Viewers
• Returns the current number of viewers in the stream.
Example (Template):
go
The streamer has {{kick.Viewers}} Viewers.
Example (JavaScript):
Title
• Returns the title of the stream.
Example (Template):
go
The stream title is {{kick.Title}}.
Example (JavaScript):
Category
• Returns the category of the stream.
Example (Template):
go
The stream is in the {{kick.Category}} category.
Example (JavaScript):
Uptime
• Returns the duration the stream has been live.
Example (Template):
go
The stream has been live for {{kick.Uptime}}.
Example (JavaScript):
Example (Template):
go
Active viewers count: {{kicklet.ActiveViewersCount}}
Example (JavaScript):
Example (Template):
go
Randomly selected viewers:
{{range $viewer := kicklet.ActiveViewersRandom 10}}
ID: {{$viewer.ID}}, Username: {{$viewer.Username}}
{{end}}
Example (JavaScript):
Example (Template):
go
Randomly selected active viewer: {{kicklet.ActiveViewerRandom.Username}}
Example (JavaScript):
Counter: Get
• Returns the number of the counter.
Example (Template):
go
This command was used {{kicklet.GetCounter "test"}} times.
Example (JavaScript):
js
const executions = Kicklet.getCounter('test')
.then(resp => resp.data);
Counter: Set
• Sets the counter to a specific number without a return.
Example (Template):
go
{{kicklet.SetCounter "test" 0}}
Counter was resetted.
Example (JavaScript):
js
Kicklet.setCounter('test', 0)
.then(resp => resp.data);
Counter: Add
• Increments the counter by 1. Returns the number of the incremented count.
Example (Template):
go
This streamer died {{kicklet.CounterAdd "test" 1}} times.
Example (JavaScript):
js
Kicklet.counterAdd('test', 1)
.then(resp => resp.data);
Points: Get
• Returns the points of the user.
Example (Template):
go
You have {{kicklet.Points sender.String}} points!
Example (JavaScript):
js
Kicklet.getPoints($event.getSender())
.then(resp => resp.data.points);
Points: Set
• Sets the points of the user and returns the points.
Example (Template):
go
You have now {{kicklet.SetPoints sender.String 100}} points!
Example (JavaScript):
js
Kicklet.setPoints($event.getSender(), 100)
.then(resp => resp.data);
Points: Add
• Adds 100 points and returns the new points of the user.
Example (Template):
go
You have now {{kicklet.AddPoints sender.String 100}} points!
Example (JavaScript):
js
Kicklet.addPoints($event.getSender(), 100)
.then(resp => resp.data);
Points: Remove
• Removes 100 points and returns the points of the user.
Example (Template):
go
You have now {{kicklet.RemovePoints sender.String 100}} points!
Example (JavaScript):
js
Kicklet.removePoints($event.getSender(), 100)
.then(resp => resp.data);
Example (Template):
go
100 Points added to {{kicklet.AddPointsViewers 100}} viewers!
Example (JavaScript):
js
Kicklet.addPointsViewers(100)
.then(resp => resp.data);
Random Number
• Returns a random number between the specified min and max values.
Example (Template):
go
Rolling a dice... You got a {{rand 1 6}}!
Example (JavaScript):
js
function getRandomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
Random Item
• Returns a random item from the list of provided items.
Example (Template):
go
Let me choose a random item for you: {{randItem "apple" "banana" "orange"}}.
Example (JavaScript):
js
const items = ["apple", "banana", "orange"];
function getRandomItem(items) {
return items[Math.floor(Math.random() * items.length)];
}
Example (Template):
go
Let me choose a random item for you: {{randItemPercentage "apple" 95 "banana"
2.5 "orange" 2.5}}.
Example (JavaScript):
js
const itemsWithPercentage = [
{ value: "apple", weight: 95 },
{ value: "banana", weight: 2.5 },
{ value: "orange", weight: 2.5 }
];
function getRandomItemPercentage(items) {
const totalWeight = items.reduce((total, item) => total + item.weight, 0);
let random = Math.random() * totalWeight;
Named
• Returns the value of the named argument from the command data. If the argument is not
found, an empty string is returned.
Example (Template):
go
You entered: {{arg "username"}}. Welcome, {{arg "username"}}!
Example (JavaScript):
Argument Retrieval
• Returns an array of all parameters from the command data.
Example (Template):
go
Command arguments: {{args}}. There are {{len args}} arguments in total.
Example (JavaScript):
js
const args = $event.getCommandArgs();
Arguments as URL query
Parameters
Example (Template):
go
{{argsUrlQuery startIndex}}
Example (JavaScript):
Time
• Returns the current time in the specified time zone. The time is formatted as "15:04".
Example (Template):
go
The current time in New York is {{time "America/New_York"}}.
Timezones
Example (JavaScript):
Formatted Time
• Returns the current time in the specified time zone and format.
Example (Template):
go
The current time in New York is {{timeFmt "America/New_York" "03:04 pm"}}.
The current time in New York is {{timeFmt "America/New_York" "15:04:05"}}.
The current time in New York is {{timeFmt "America/New_York" "Monday January
_2 15:04:05 2006"}}.
The current time in New York is {{timeFmt "America/New_York" "Mon Jan _2
15:04:05 2006"}}.
Formatting
yml
Year: "2006" "06"
Month: "Jan" "January" "01" "1"
Day of the week: "Mon" "Monday"
Day of the month: "2" "_2" "02"
Day of the year: "__2" "002"
Hour: "15" "3" "03" (PM or AM)
Minute: "4" "04"
Second: "5" "05"
AM/PM mark: "PM"
Example (JavaScript):
Example (Template):
go
You shouted: {{upper "hello, world!"}}.
Example (JavaScript):
js
console.log("hello, world!".toUpperCase());
Example (Template):
go
You whispered {{lower "I LOVE CHOCOLATE"}}.
Example (JavaScript):
js
console.log("I LOVE CHOCOLATE".toLowerCase());
Minecraft Players
• Returns the current player count of a Minecraft server or network.
Example (Template):
go
There are currently {{minecraft.Players "hypixel.net"}} players on
Hypixel.net!
Example (JavaScript):
js
const playersCount = Minecraft.players('hypixel.net')
.then(resp => resp.data);
Example (Template):
go
Here are the commands available: {{kicklet.Commands}}
Example (JavaScript):
js
const commands = Kicklet.commands()
.then(resp => resp.data);
Example (Template):
go
You have permission to use the following commands:
{{kicklet.CommandsWithPermission}}
Example (JavaScript):
js
const commandsWithPerms = Kicklet.commandsWithPermissions()
.then(resp => resp.data);
Check Permissions
• Returns a boolean value indicating whether the sender has the corresponding permission.
Example (Template):
go
{{if sender.HasPermission "broadcaster"}}
You are a broadcaster!
{{else}}
You are not a broadcaster..
{{end}}
Example (JavaScript):
js
$event.getSender().hasPermission('broadcaster')
Fetch JSON
• Returns the object that the API provides. You can then access this object to process
individual values.
Example (Template):
go
{{$response := http.GetJson "https://swapi.dev/api/people/1"}}
Name: {{ $response.name }}
Example (JavaScript):
Example (Template):
go
{{$response := http.GetJsonWithHeaders "https://example.com" (dict
"Authorization" "mySuperSecretToken")}}
Name: {{ $response.name }}
Example (JavaScript):
Fetch Text
• Returns the text that the API provides.
Example (Template):
go
{{http.GetText "https://example.com"}}
Example (JavaScript):
Example (Template):
go
{{http.GetTextWithHeaders "https://example.com" (dict "Authorization"
"mySuperSecretToken")}}
Example (JavaScript):
Calculate: Add
• Adds a number to the value of another number.
Example (Template):
go
{{$number := 10}}
Adding 2 to {{$number}} results in {{$number := add $number 2}}
{{$number}}.
Example (JavaScript):
Calculate: Summing
• Calculates the sum of the values.
Example (Template):
go
{{$number := 10}}
Summing {{$number}} with 2, 3, and 4 gives {{$result := sum $number 2 3 4}}
{{$result}}.
Example (JavaScript):
Calculate: Subtracting
• Subtracts a number from another number.
Example (Template):
go
{$number := 10}}
Subtracting 2 from {{$number}} leads to {{$number := sub $number 2}}
{{$number}}.
Example (JavaScript):
Calculate: Multiplying
• Multiplies
Example (Template):
go
{{$number := 10}}
Multiplying {{$number}} by 2.1 gives {{$number := mul $number 2.1}}
{{$number}}.
Example (JavaScript):
Calculate: Dividing
• Divides two numbers.
Example (Template):
go
{{$number := 10}}
Dividing {{$number}} by 2 yields {{$number := div $number 2}}
{{$number}}.
Example (JavaScript):
Calculate: Modulo
• Returns the remainder of a number divided by another number.
Example (Template):
go
{{$number := 10}}
The remainder of {{$number}} divided by 2 is {{$remainder := mod $number 2}}
{{$remainder}}.
Example (JavaScript):
Parse: Int
• This function is used to convert a string representation of an integer into an actual integer
value. This is useful when you have numeric data stored as strings and need to perform
mathematical operations or comparisons with them.
Example (Template):
go
{{ $str := "42" }}
{{ $intVal := parseInt $str }}
Parsed Integer: {{ $intVal }}
Example (JavaScript):
Parse: Float
• This function is used to convert a string representation of a floating-point number into an
actual float value. This is helpful when you're dealing with decimal numbers stored as
strings and need to perform calculations involving fractions.
Example (Template):
go
{{ $str := "3.14" }}
{{ $floatVal := parseFloat $str }}
Parsed Float: {{ $floatVal }}
Example (JavaScript):
Example (Template):
go
{{$strInt := "12"}}
{{isInt $strInt}}
{{$strFloat := "12.7"}}
{{isFloat $strFloat}}
Example (JavaScript):
js
// Check if a variable is an integer
const strInt = "12";
const isInteger = Number.isInteger(Number(strInt));
console.log(`Is "${strInt}" an integer:`, isInteger);
Define a variable
• Defines the $variableName as a string with the value "value".
Example (Template):
go
{{$variableName := "value"}}
Example (JavaScript):
js
// Using let
let variableName = "value";
Example (Template):
go
{{$variableName := ""}}
{{if eq $variableName ""}}
{{$variableName = "test"}}
{{end}}
Example (JavaScript):
Use a variable
• Represents the variable 'variableName' and its value can be used.
Example (Template):
go
{{$variableName := "value"}}
{{$variableName}}
Example (JavaScript):
Define
• With define, you can create a named reusable template section in your Go template.
This allows you to define a specific piece of template logic and then call it multiple times
using its name.
Example (Template):
go
{{define "greeting"}}
Hello {{sender}}! How are you?
{{end}}
{{template "greeting"}} This will render the "greeting" template at any other
point in code.
Example (JavaScript):
Example (Template):
go
{{define "customGreeting"}}
Hello, {{.Name}}! {{.Message}}
{{end}}
Example (JavaScript):
If statement
• If statements are used to conditionally execute code based on specified conditions.
Example (Template):
go
{{$string := "test"}}
{{if eq $string "test"}}
The String is test.
{{end}}
Example (JavaScript):
js
let string = "test";
if (string === "test") {
console.log("The string is test.");
}
If-Else Statement
• If-Else statements are used to provide an alternative code block that executes when the
condition specified in the If statement is not met.
Example (Template):
go
{{$string := "test"}}
{{if eq $string "test"}}
The String is test.
{{else}}
The String is not test.
{{end}}
Example (JavaScript):
js
let string = "test";
if (string === "test") {
console.log("The string is test.");
} else {
console.log("The string is not test.");
}
If-Else If Statement
• If-Else If statements allow you to test multiple conditions in a sequential manner. When
the first condition is met, the corresponding code block is executed, and the rest of the
conditions are not checked.
Example (Template):
go
{{$value := 3}}
{{if eq $value 1}}
The value is 1.
{{else if eq $value 2}}
The value is 2.
{{else if eq $value 3}}
The value is 3.
{{else}}
The value is something else.
{{end}}
Example (JavaScript):
js
let value = 3;
if (value === 1) {
console.log("The value is 1.");
} else if (value === 2) {
console.log("The value is 2.");
} else if (value === 3) {
console.log("The value is 3.");
} else {
console.log("The value is something else.");
}
Example (Template):
go
The first element of the array is: {{index array 0}}
Example (JavaScript):
js
let array = ['apple', 'banana', 'cherry'];
console.log("The first element of the array is:", array[0]);
Example (Template):
go
This command has the following args: {{argsString 0}}
Example (JavaScript):
Create a command
• Will create a command with a response.
Example (Template):
go
{{$resp := kicklet.CreateCommand "discord" "Join on my discord:
discord.gg/my-discord"}}
{{if eq $resp.Error 0}}
create command successfully
{{else if eq $resp.Error 1}}
command limit is reached
{{else if eq $resp.Error 2}}
command already exists
{{end}}
Example (JavaScript):
Edit a command
• Will edit the command with the response.
Example (Template):
go
{{$resp := kicklet.EditCommand "command" "new message"}}
{{if eq $resp.Error 0}}
command updated successfully
{{else if eq $resp.Error 1}}
command not exists
{{end}}
Example (JavaScript):
Activate/deactivate a command
• Will activate/deactivate the specific command.
Example (Template):
go
{{$resp := kicklet.ActivateCommand "discord" true}}
{{if eq $resp.Error 0}}
command activated successfully
{{else if eq $resp.Error 1}}
command not exists
{{end}}
Example (JavaScript):
Example (Template):
go
{{$resp := kicklet.ActivateCommandGroup "groupName" true}}
{{if eq $resp.Error 0}}
command group activated successfully
{{else if eq $resp.Error 1}}
command group not exists
{{end}}
Example (JavaScript):
EQ
Example (Template):
go
{{if eq 10 10}}
This condition is true.
{{else}}
This condition is false.
{{end}}
NE
Example (Template):
go
{{if ne "apple" "banana"}}
This condition is true.
{{else}}
This condition is false.
{{end}}
LT
Example (Template):
go
{{if lt 5 10}}
This condition is true.
{{else}}
This condition is false.
{{end}}
LE
• Returns the boolean truth of whether arg1 is less than or equal to arg2.
Example (Template):
go
{{if le 20 20}}
This condition is true.
{{else}}
This condition is false.
{{end}}
GT
Example (Template):
go
{{if gt 100 50}}
This condition is true.
{{else}}
This condition is false.
{{end}}
GE
• Returns the boolean truth of whether arg1 is greater than or equal to arg2.
Example (Template):
go
{{if ge 30 40}}
This condition is true.
{{else}}
This condition is false.
{{end}}
Example (Template):
go
{{discord.SendMessage "https://discord.com/api/webhooks/xx/xx" "discord"}}
{{define "discord"}}
{"content": "{{sender}} has {{kick.Followers}} followers"}
{{end}}
Example (JavaScript):
js
const json = {
"content": "Hello from JavaScript!"
};
function sendDiscordWebhook() {
Discord.sendMessage('https://discord.com/api/webhooks/xx/xx', json);
}
Console Logging
• Logs the provided object to the console. Note that the console log is limited to 100 items,
and if the provided string is longer than 200 characters, it won't be logged.
Example (Template):
go
{{console "hello console!"}}
Example (JavaScript):
js
console.log('hello console!');
Comments
• Represents a comment in the code that neither provides functionality nor gets rendered in
the template.
Example (Template):
go
{{/* Author: Kicklet */}}
Example (JavaScript):
js
// Author: Kicklet
Example (Template):
go
{{kicklet.Currency}}
Example (JavaScript):
js
const currency = Kicklet.getCurrency();
go
{{kicklet.MessagesCount "kickUsername"}}
go
{{kicklet.MessagesCount sender.String}}
Example (JavaScript):
js
const messages = Kicklet.messagesCount('kickUsername')
.then(resp => resp.data);
Example (Template):
go
{{kicklet.CommandsExecutions "1d"}}
Example (JavaScript):
js
const executions = Kicklet.commandsExecutions('1d')
.then(resp => resp.data);
Specific Command Execution Amount
• Returns the command execution amount for a specific command in the last given
timespan.
Example (Template):
go
{{kicklet.CommandExecutions "command" "1d"}}
Example (JavaScript):
js
const executions = Kicklet.commandExecutions('command', '1d')
.then(resp => resp.data);
Parameters
• amount (String): Indicates the number of top commands to be displayed. For example,
the top 5.
• timespan (String): Specifies the time span for which the command ranking should be
shown. For example, "1d".
Example (Template):
go
{{kicklet.CommandsExecutionsRanking 5 "1d"}}
Example (JavaScript):
Current Song
• Returns the current song playing in the requests.
Example (Template):
go
{{kicklet.CurrentSongTitle}}
Example (JavaScript):
js
const currentSong = Kicklet.getCurrentSong()
.then(resp => resp.data.title);
Example (Template):
Example (JavaScript):
js
Kicklet.clearSongRequests();
Skip Song
• Returns: result.
Example (Template):
Example (JavaScript):
js
Kicklet.skipSong();
Request a Song
• Returns: result.
Example (Template):
No Template example exists yet.
Example (JavaScript):
js
const sender = $event.getSender();
const result = Kicklet.songRequest(sender, 'video-id', 300);
Parameters
Example (Template):
go
{{kicklet.SetGlobalVar "myVariable" "theValue" 600}}
go
{{kicklet.SetGlobalVar "myVariable" "theValue" 0}}
Example (JavaScript):
js
Kicklet.setGlobalVar('myVariable', 'theValue', 600);
This variable will exists forever:
js
Kicklet.setGlobalVar('myVariable', 'theValue');
Parameters
• variableName (String): The name of the global variable for which you want to retrieve
the value.
Example (Template):
go
{{kicklet.GetGlobalVar "myVariable"}}
Example (JavaScript):
js
const value = Kicklet.getGlobalVar('myVariable');
Parameters
• variableName (String): The name of the global variable for which you want to delete the
value.
Example (Template):
go
{{kicklet.DeleteGlobalVar "myVariable"}}
Example (JavaScript):
js
Kicklet.deleteGlobalVar('myVariable');
Parameters
Example (Template):
The following example illustrates how to assign the value theValue to the variable myVariable.
The variable has a lifespan of 120 seconds.
go
{{kicklet.SetViewerVar "myVariable" sender.String "theValue" 120}}
The following example demonstrates how to assign the value theValue to the variable
myVariable for the specific user. Since the TTL is set to 0, the variable will be stored
permanently and will not expire.
go
{{kicklet.SetViewerVar "myVariable" sender.String "theValue" 0}}
Example (JavaScript):
js
const sender = $event.getSender();
Kicklet.setViewerVar('myVariable', sender, {
points: 12,
anotherThing: 'just a string'
}, 120);
Get Viewer Variable
Retrieves the value of a viewer variable based on the specified variable name and viewer.
Parameters
• variableName (String): The name of the variable for which you want to retrieve the
value.
• viewer (String): The name of the viewer/user for whom the variable value is being
retrieved.
Example (Template):
go
{{kicklet.GetViewerVar "myVariable" sender.String}}
Example (JavaScript):
js
const sender = $event.getSender();
const v = Kicklet.getViewerVar('myVariable', sender);
Parameters
• variableName (String): The name of the variable for which you want to delete the value.
• viewer (String): The name of the viewer/user for whom the variable value is being
deleted.
Example (Template):
go
{{kicklet.DeleteViewerVar "myVariable" sender.String}}
Example (JavaScript):
js
const sender = $event.getSender();
Kicklet.deleteViewerVar('myVariable', sender);
Parameters
• variableName (String): The name of the variable for which you want to clear all
instances.
Example (Template):
go
{{kicklet.ClearViewerVar "myVariable"}}
Example (JavaScript):
js
// delete variable myVariable for all viewers
Kicklet.clearViewerVar('myVariable');
Play Gif
Plays a GIF for a specified duration.
Parameters
• url (String): The URL of the GIF to play. It must be a string pointing to a valid GIF file.
• duration (Integer): The duration in seconds for which the GIF should be played.
Example (Template):
go
{{kicklet.PlayGif "https://files.kicklet.app/the-file.gif" 5}}
Example (JavaScript):
js
async function play() {
await Kicklet.playGif('https://files.kicklet.app/the-file.gif', 5);
}
TIP
Pressing CTRL + I in the Advanced Editor opens the menu for selecting asset files.
Play Sound
Plays a sound file for a specified duration with optional volume control.
Parameters
• url (String): The URL of the sound file to play. It must be a string pointing to a valid
sound file.
• duration (Integer): The duration in seconds for which the sound should be played.
• volume (Integer, optional): The volume percentage from 0 to 100. If not specified, the
default volume setting will be used.
Example (Template):
go
{{kicklet.PlaySound "https://files.kicklet.app/the-file.mp3" 5 10}}
Example (JavaScript):
js
async function play() {
await Kicklet.playSound('https://files.kicklet.app/the-file.mp3', 5, 10);
}
TIP
Pressing CTRL + I in the Advanced Editor opens the menu for selecting asset files.
Parameters
Example (Template):
go
{{kicklet.PlaySoundGif "https://files.kicklet.app/the-sound.mp3"
"https://kicklet.app/the-gif.gif" 5 10}}
Example (JavaScript):
js
async function play() {
await Kicklet.playSoundGif('https://files.kicklet.app/the-sound.mp3',
'https://kicklet.app/the-gif.gif', 5, 10);
}
TIP
Pressing CTRL + I in the Advanced Editor opens the menu for selecting asset files.
Custom Event
Initiates a custom event, optionally carrying extra data, designed for integration within custom
overlay widgets.
Parameters
Example (Template):
go
{{kicklet.CustomEvent "myEvent" "a additional text"}}
{{kicklet.CustomEvent "myEvent" nil}}
{{kicklet.CustomEvent "myEvent" 190}}
{{kicklet.CustomEvent "myEvent" (dict "text" "a simple text as variable"
"num" 190)}}
Example (JavaScript):
js
async function trigger() {
await Kicklet.customEvent('myEvent', {
text: 'a simple text as variable',
num: 190,
});
}
Parameters
Example (Template):
go
{{kicklet.SetAutoTitle "my stream title"}}
Example (JavaScript):
js
await Kicklet.setAutoTitle('my stream title');
Parameters
• isActive (Boolean): A boolean value to activate (true) or deactivate (false) the auto title
setting.
Example (Template):
go
{{kicklet.SetAutoTitleActive true}}
{{kicklet.SetAutoTitleActive false}}
Example (JavaScript):
js
await Kicklet.setAutoTitleActive(true);
await Kicklet.setAutoTitleActive(false);
Timeout
Temporarily prevents a user from interacting with the chat for a specified duration in minutes.
Parameters
• user (String): The username of the user to be timed out. This can be sender or a specific
username.
• duration (Integer): The duration of the timeout in minutes.
Example (Template):
go
{{kick.Timeout sender 1}}
{{kick.Timeout "JohnKicklet" 1}}
Example (JavaScript):
js
await Kick.timeout('JohnKicklet', 1);
Ban
Permanently prevents a user from interacting with the chat.
Parameters
• user (String): The username of the user to be timed out. This can be sender or a specific
username.
Example (Template):
go
{{kick.Ban sender}}
{{kick.Ban "JohnKicklet"}}
Example (JavaScript):
js
await Kick.ban('JohnKicklet');
Clear Chat
Clears all messages in the chat.
Example (Template):
go
{{kick.ClearChat}}
Example (JavaScript):
js
await Kick.clearChat();
Ban All
Bans all users whose messages match the given text.
Parameters
Example (Template):
go
Banned {{kick.BanAll "hello"}} viewers
Example (JavaScript):
js
async function ban() {
await Kick.banAll('hello');
}
Parameters
Example (Template):
go
Banned {{kick.BanAll "hello" "vip" "og"}} viewers
Example (JavaScript):
js
async function ban() {
await Kick.banAll('hello', {
excludedRoles: ['vip', 'og'],
});
}
Parameters
Example (Template):
go
Banned {{kick.BanAllSimilarity "hello" 40}} users
Example (JavaScript):
js
async function ban() {
await Kick.banAll('hello', {
similarity: 40,
});
}
Ban All with Similarity Threshold and Excluded Roles
Bans all users whose messages match the given text based on a similarity threshold, excluding
users with specified roles.
Parameters
Example (Template):
go
Banned {{kick.BanAllSimilarity "hello" 40 "vip" "og"}} users
Example (JavaScript):
js
async function ban() {
await Kick.banAll('hello', {
similarity: 40,
excludedRoles: ['vip', 'og'],
});
}
Timeout All
Temporarily prevents all users whose messages match the given text from interacting with the
chat for a specified duration in minutes.
Parameters
Example (Template):
go
Timed out {{kick.TimeoutAll "hello" 2}} users two minutes
Example (JavaScript):
js
async function timeout() {
await Kick.timeoutAll('hello', 2);
}
Parameters
Example (Template):
go
Timed out {{kick.TimeoutAll "hello" 2 "vip" "og"}} users two minutes
Example (JavaScript):
js
async function timeout() {
await Kick.timeoutAll('hello', 2, {
excludedRoles: ['vip', 'og'],
});
}
Parameters
Example (Template):
go
Timed out {{kick.TimeoutAllSimilarity "hello" 2 40}} users two minutes
Example (JavaScript):
js
async function timeout() {
await Kick.timeoutAll('hello', 2, {
similarity: 40,
});
}
Parameters
Example (Template):
go
Timed out {{kick.TimeoutAllSimilarity "hello" 2 40 "vip" "og"}} users two
minutes
Example (JavaScript):
js
async function timeout() {
await Kick.timeoutAll('hello', 2, {
similarity: 40,
excludedRoles: ['vip', 'og'],
});
}
Parameters
• voice (String): The voice to be used for the TTS. This could be a predefined voice type
available in the system.
• text (String): The text to be converted to speech.
Example (Template):
go
{{ kicklet.TTS "Brian" "Hello, this is a test message." }}
Example (JavaScript):
js
await Kicklet.tts('Brian', 'Hello, this is a test message.');
Voices