import CommandDialog from './CommandDialog';
import Commands from './Commands';
import GuessingSettingsForm from './GuessingSettingsForm';
+import ChatBotLog from '../chat-bot-logs/ChatBotLog';
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);
}
}, [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 });
</Button>
)}
</div>
+ <div className="mt-3">
+ <Button
+ onClick={() => { adlibChat(); }}
+ title={t('twitchBot.adlibChatDesc')}
+ variant="outline-secondary"
+ >
+ {t('twitchBot.adlibChat')}
+ </Button>
+ <p className="text-muted">{t('twitchBot.adlibChatNote')}</p>
+ </div>
</Col>
<Col className="mt-5" md={6}>
- <h3>{t('twitchBot.chatSettings')}</h3>
+ <div className="d-flex justify-content-between">
+ <h3>{t('twitchBot.chatSettings')}</h3>
+ <div className="button-bar">
+ <ChatBotLog id={channel.id} />
+ </div>
+ </div>
<ChatSettingsForm channel={channel} onSubmit={saveChatSettings} />
</Col>
<Col className="mt-5" md={12}>