X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Ftwitch-bot%2FControls.js;h=394f5464c6369ec4049d342861a287396bb468f1;hb=f0d1a566f5afd76ab7a56b295b71d5756dfd2bc3;hp=f64ee62712a658da228c4ebacbc895d55931bf35;hpb=a45648fa8ecf7712c7fd00eb2b93e862b5264f04;p=alttp.git diff --git a/resources/js/components/twitch-bot/Controls.js b/resources/js/components/twitch-bot/Controls.js index f64ee62..394f546 100644 --- a/resources/js/components/twitch-bot/Controls.js +++ b/resources/js/components/twitch-bot/Controls.js @@ -68,6 +68,18 @@ const Controls = () => { } }, [channel, chatText, t]); + const adlibChat = React.useCallback(async () => { + try { + await axios.post(`/api/channels/${channel.id}/chat`, { + bot_nick: 'horstiebot', + adlib: true, + }); + toastr.success(t('twitchBot.chatSuccess')); + } catch (e) { + toastr.error(t('twitchBot.chatError')); + } + }, [channel, chatText, t]); + const join = React.useCallback(async (bot_nick) => { try { const rsp = await axios.post(`/api/channels/${channel.id}/join`, { bot_nick }); @@ -247,6 +259,16 @@ const Controls = () => { )} +
+ +

{t('twitchBot.adlibChatNote')}

+