mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2026-04-23 17:44:20 +00:00
Add replace method to messages variable
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
export const messages = {
|
||||
replace(message: string, variables: { [key: string]: string }){
|
||||
for(let variable in variables){
|
||||
if(variable.includes('%')){
|
||||
message = message.replace(variable, variables[variable]);
|
||||
} else if(variable.includes(':')){
|
||||
message = message.replace(variable.split(':')[0], variables[variable]);
|
||||
} else {
|
||||
message = message.replace(variable, variables[variable]);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
wrongVoiceChannel: "You need to be in the same voice channel as RadioX to use this command!",
|
||||
noPerms: "You need the %command.permission% permission to use this command!",
|
||||
notPlaying: "There is nothing playing!",
|
||||
|
||||
Reference in New Issue
Block a user