+ const chat = React.useCallback(async text => {
+ try {
+ await axios.post(`/api/channels/${channel.id}/chat`, {
+ text,
+ });
+ toastr.success(t('twitchBot.chatSuccess'));
+ } catch (e) {
+ toastr.error(t('twitchBot.chatError'));
+ }
+ }, [channel, chatText, t]);
+