1
0

🐛 Fix connection bad conditional and set default

channel for client actions
This commit is contained in:
2021-06-18 18:26:26 +02:00
parent f23e8cb81b
commit 589da6d5f5

View File

@@ -16,9 +16,11 @@ export {
async function connect(authProvider: AuthProvider, channels: Array<any>) {
if (
!chatClient ||
chatClient &&
(
chatClient.isConnecting ||
chatClient.isConnected
)
) {
return;
}
@@ -52,15 +54,16 @@ async function handleClientAction(action: any) {
action.username = await getUsernameFromId(parseInt(action.username));
}
// TODO: create a interface for action messages
if (!action.channel) {
action.channel = "alexbcberio";
}
switch (action.action) {
case "say":
// TODO: check if it works
// say(channel, action.message);
say(action.channel, action.message);
break;
case "timeout":
// TODO: check if it works
// await timeout(channel, action.username, action.time, action.reason);
await timeout(action.channel, action.username, action.time, action.reason);
break;
case "broadcast":