💥 Remove try/catch from timeout
Call to this method should now be surrounded by try catch
This commit is contained in:
@@ -15,11 +15,7 @@ async function timeout(
|
|||||||
reason = "";
|
reason = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
await chatClient.timeout(channel, username, time, reason);
|
||||||
await chatClient.timeout(channel, username, time, reason);
|
|
||||||
} catch (e) {
|
|
||||||
// user cannot be timed out
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export { timeout };
|
export { timeout };
|
||||||
|
@@ -57,7 +57,11 @@ async function handleClientAction(action: Action): Promise<void> {
|
|||||||
say(channel, action.data.message);
|
say(channel, action.data.message);
|
||||||
break;
|
break;
|
||||||
case ActionType.Timeout:
|
case ActionType.Timeout:
|
||||||
await timeout(channel, username, action.data.time, action.data.reason);
|
try {
|
||||||
|
await timeout(channel, username, action.data.time, action.data.reason);
|
||||||
|
} catch (e) {
|
||||||
|
// user cannot be timed out
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ActionType.Broadcast:
|
case ActionType.Broadcast:
|
||||||
broadcast(action.data.message);
|
broadcast(action.data.message);
|
||||||
|
Reference in New Issue
Block a user