X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftwitch-bot%2FControls.js;h=394f5464c6369ec4049d342861a287396bb468f1;hb=f0d1a566f5afd76ab7a56b295b71d5756dfd2bc3;hp=51f0633a226bdc1f5626a47ee9778ba77d160ac2;hpb=147c5f43c5d41fa18e82edb6651fe5a37c789353;p=alttp.git diff --git a/resources/js/components/twitch-bot/Controls.js b/resources/js/components/twitch-bot/Controls.js index 51f0633..394f546 100644 --- a/resources/js/components/twitch-bot/Controls.js +++ b/resources/js/components/twitch-bot/Controls.js @@ -13,7 +13,27 @@ import ChannelSelect from '../common/ChannelSelect'; import Icon from '../common/Icon'; import ToggleSwitch from '../common/ToggleSwitch'; -const CHAT_CATEGORIES = ['unclassified', 'hi', 'gl', 'gg', 'lol', 'pog', 'hype', 'o7']; +const CHAT_CATEGORIES = [ + 'unclassified', + 'hi', + 'gl', + 'gg', + 'eyes', + 'love', + 'lol', + 'yes', + 'no', + 'rage', + 'sad', + 'sweat', + 'wtf', + 'pog', + 'hype', + 'kappa', + 'o7', + 'question', + 'thx', +]; const Controls = () => { const [channel, setChannel] = React.useState(null); @@ -48,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 }); @@ -227,6 +259,16 @@ const Controls = () => { )} +
+ +

{t('twitchBot.adlibChatNote')}

+