Skip to content

Releases: BOLL7708/desbot

v3.462 Hotfix & Time Text Tags

02 Aug 20:46
Compare
Choose a tag to compare

This is a hotfix.

Fixed a few things that TypeScript did not tell me about, sheesh!

Also added requested time values to the text tags.

v3.459 Custom Code & TTS Actions

31 Jul 20:42
Compare
Choose a tag to compare

Random Stuff

  • Login page has hopefully gotten clearer.
  • Running the scale command now interrupts a scaling sequence.
  • Fixed reward toggling by main profiles, the logic was faulty.
  • A ton of new text tags, see full list here.

New Features

Custom Code Action

This action can contain and execute any arbitrary code you want. It's basically a way to extend the widget without creating new classes or adding more files, just plug your code into this action and go.

[Keys.COMMAND_EXAMPLE]: {
  actions: {
    custom: {
      tag: 'Tag',
      description: 'A short description',
      call: async (user) => { // The async is needed if you use `await` in the code.
        const modules = ModulesSingleton.getInstance() // Get access to all modules.
        modules.tts.enqueueSpeakSentence(
          await Utils.replaceTagsInText('%userTag just did a custom thing!', user)
        )
        console.log(`${user.name} just triggered a custom action!`)
      }
    }
  }
}

TTS Action

This was a huge amount of work, but now pretty much ALL features of the TTS system are callable as actions. Meaning you can make rewards for what was commands before, like setting nick, or commands for what was a reward before, like setting voice. All existing TTS commands that were previously hard-coded, are now in the templates.

[Keys.COMMAND_EXAMPLE]: {
  actions: {
    tts: { function: ETTSFunction.SetUserVoice } // For all commands, check the enum `ETTSFunction`.
    inputOverride: 'kr' // This is optional, and can be used if you don't want the user input to decide what happens. This would set someone's voice to Korean.
  }
}

Config Changes

Removed References

TTS References

Things removed from Config.controller.speechReferences.

  • COMMAND_TTS_ON
  • COMMAND_TTS_OFF
  • COMMAND_TTS_MUTE
  • COMMAND_TTS_UNMUTE
  • COMMAND_TTS_NICK
  • COMMAND_DICTIONARY

Chat References

Things removed from Config.controller.chatReferences.

  • COMMAND_DICTIONARY
  • COMMAND_TTS_NICK

Rename

In Config.google.cleanTextConfig

  • removeParantheses was spell-corrected to removeParentheses

Template Changes

Removed Rewards

  • REWARD_TTSSETVOICE
  • REWARD_TTSSWITCHVOICEGENDER

Removed Commands

  • COMMAND_DICTIONARY

Updated Commands

  • COMMAND_TTS_ON
  • COMMAND_TTS_OFF
  • COMMAND_TTS_SILENCE
  • COMMAND_TTS_DIE
  • COMMAND_TTS_NICK
  • COMMAND_TTS_MUTE
  • COMMAND_TTS_UNMUTE

Added Commands

  • COMMAND_TTS_GETNICK
  • COMMAND_TTS_CLEARNICK
  • COMMAND_TTS_GETVOICE
  • COMMAND_TTS_GENDER
  • COMMAND_DICTIONARY_SET
  • COMMAND_DICTIONARY_GET
  • COMMAND_DICTIONARY_CLEAR

Added Event (Command & Reward)

  • EVENT_TTSSETVOICE

Key Changes

Things that has changed in _data/!keys.ts.

Removed Keys

  • COMMAND_DICTIONARY
  • REWARD_TTSSETVOICE
  • REWARD_TTSSWITCHVOICEGENDER

Updated Keys

  • COMMAND_TTS_DIE
  • COMMAND_TTS_NICK

Added Keys

  • EVENT_TTSSETVOICE
  • COMMAND_TTS_GETNICK
  • COMMAND_TTS_CLEARNICK
  • COMMAND_TTS_GETVOICE
  • COMMAND_TTS_GENDER
  • COMMAND_DICTIONARY_SET
  • COMMAND_DICTIONARY_GET
  • COMMAND_DICTIONARY_CLEAR

v3.432 Login & Tokens

18 Jul 22:18
Compare
Choose a tag to compare

New Features

There is only one new feature, but it feels major enough to make a separate release for it. If the widget now lacks tokens from Twitch, it will automatically show a login form that lets you retrieve said tokens, for either the channel or chatbot user.

This will invariably happen for everyone, because the format for storing the tokens has changed so it is using a new file, which will be created when you sign in.

Config Changes

This is in ./_configs/config.php, a few values were moved here for the login page to work, there are instructions on how to get these values on the login page itself.

return (object) [
  'twitchClientId' => 'The client ID for your Twitch application',
  'twitchClientSecret' => 'The client secret for your Twitch application'
];

These values as well as initial token values were removed from the TypeScript config.

Config.credentials = {
  // THESE WERE REMOVED
  TwitchClientID: '',
  TwitchClientSecret: '',
  TwitchChannelRefreshToken: '',
  TwitchChatbotRefreshToken: '',
}

v3.427 Timelines, Remote Commands & Reward States

13 Jul 16:12
Compare
Choose a tag to compare

New Features

Timeline

The timeline function lets you, well, create a timeline with actions that gets executed instead of just a pool of actions that are instantly triggered. You make one by replacing the normal actions property with one keyed on milliseconds.

[Keys.COMMAND_EXAMPLE]: {
  triggers: {
    command: {}
  },
  actions: {
    [0]: {
      chat: 'The first message!'
    },
    [10000]: {
      chat: 'A message after 10 seconds!'
    }
  }
}

Remote Commands

This feature allows the widget to connect to a separate Twitch chat where it will listen to commands from a list of allowed users. This way multiple widgets can share event triggering, or trigger things in other widgets at will.

There are a number of things in the config for this, see below.

// Config.controller.defaults
{
  runRemoteCommands: false // Default is false, set to true to enable
}
// Config.twitch
{
    remoteCommandChannel: 'a_channel',
    remoteCommandPrefix: '!',
    remoteCommandAllowedUsers: ['yourself_for_testing', 'a_friends_chat_bot'],
}

There are also an accompanying trigger and action.

// An event
{
  triggers: {
    remoteCommand: {
      cooldown: 10 // Optional
    }
  }
}
// A different event
{
  actions: {
    remoteCommand: '!TriggerEvilThing' // Sent by your chat bot account
  }
}

Reward States Action

This action can set the state of a reward, the state is just enabled or disabled. It will make the button for the reward appear or disappear if there was a change.
A key feature of this action is that it also adds/removes these rewards from the state overrides in the config, so even if you switch game something you turned on or off will stay on or off. This persists until you reload the widget, as it is only changed in memory, the widget cannot write the configs to disk, so keep that in mind.

// An event
{
  actions: {
    rewardStates: {
      [Keys.A_REWARD]: false, // Will be disabled
      [Keys.ANOTHER_REWARD]: true // Will be enabled
    }
  }
}

Updated Features

Text Tags have been updated, when someone cheers or subs now, we save a few values which can be called upon later. If no value has been saved, 0 will be returned. The bits existed since before, but were only available for cheer events.

%userBits
%userBitsTotal
%userSubsTotal
%userSubsStreak

Config Updates

Most of the additions you can actually see up in the new features section for Remote Commands, so check that out. Otherwise I've added a bunch of more pre-defined values in both the configs and presets. This to make it a bit easier for new users to get going. If you think something is still missing, don't hesitate telling me and I'll consider putting it in there!

There was one thing though, I added this setting so you can change what prefix is used for commands, if you would want to do that. ! is an extremely common standard symbol to use for this though, but now the option exists.

// Config.twitch
{
  commandPrefix: '!'
}

v3.414 Whispers, cheers & timers

07 Jul 17:19
Compare
Choose a tag to compare

Still figuring out how to do these releases. Was going to squash develop into master, but then it seemed like squashing in git was a destructive action, so I merged this time around.

Feature Changes

  • It is now possible to announce cheer amounts in chat. You can see an example of this in the template or below, and you add your levels and announcements in Config.twitch.announceCheers.
announceCheers: [
  {bits: 1, message: '%userTag cheered %userBits bits! (will be the default message)'},
  {bits: 100, message: 'Wow %userTag cheered %userBits bits! (for 100 or more)'}
],
  • The label action can now append when writing to file instead of just replacing the prior content, example:
label: {
  fileName: "yourlabel.txt",
  text: `%userName was here`,
  append: true
}
  • The !raid command messages are now possible to skip if you replace the messages in the config Config.controller.chatReferences[Keys.COMMAND_RAID] with empty strings.

New Triggers

  • timer - Execute an event on a fixed timer, with an optional count and initial delay, put this in an event's triggers:
timer: {
  interval: 120,
  times: 10,
  delay: 240   
}

New Actions

  • whisper - Send a Twitch whisper to a user using the account set as chat bot.
whisper: {
  entries: 'You have been whispered!',
  user: '%userLogin'
}

Removed Actions

  • audioUrl - This action became redundant as the same thing can now be done with the base audio action and tags. See below on how to do it now, just put this in the actions for an event.
audio: {
  src: '%userInput'
}

Config Changes

Moved Config.twitch.channelTrophyUniqueNumbers to Config.controller.channelTrophySettings.uniqueNumbers.

v3.401 Events & stuff

02 Jul 09:41
Compare
Choose a tag to compare

First release! Why 3.x? It just felt right. I think there's been at least two major rewrites/transitions so at least a major version of 3 seemed like a good idea. The other number is just the amount of commits on the project, I'm lazy like that.

I will plug in what I posted on Discord here, because my memory is failing me, which is why I need these release notes myself. As a form of documentation of what has changed, and when. The idea is that if you are behind on the releases, these update notes will be individual update steps to reach the latest release. So, if there are major restructuring going on, it will be descried here.

In this case, there has been another shift of where things are. Not as bad as when actions move into the rewards, that was a mess, but still some amount of reshuffling.

To generalize Actions even more, they are now inside of Events, and these have Triggers that represent all the ways they can be activated. This means anything you set up for a reward or chat command can be reused for the other, with ease. You can even have an event that is triggered by either at the same time, so flexible! This means it is also quite straight forward to migrate from non-affiliate on Twitch using commands, to affiliate using rewards.

Config Changes

What we are practically doing is to move actions from the Reward configs to actions in the new Event configs.
Then we take the Reward config itself and put that inside triggers in the Event configs. A bit of a juggle, and as a reference of how things should look, you can check out these new template files:

  • config+commands.template.ts
  • config+rewards-template.ts

You can with benefit copy in the commands and rewards templates above, because all default commands rewards now rely on these events that we will create, so all previously existing ones have been moved into these template files. What has changed is that they now reference additional callbacks specific for their Keys, so as long as the command or reward uses a specific key, they will also use the additional functionality.

These config locations for Reward configs have been removed, you should move the contents of these into the events in the next section.

Config.twitch.commandConfigs
Config.twitch.defaultRewardConfigs
Config.twitch.rewardConfigs
Config.twitch.gameRewardDefaultConfigs
Config.twitch.gameRewardConfigs

These are the two new pools that will contain all reward and chat command configs from now on. As you can see these are not grouped under Twitch like the old reward pools, but wholly separate event pools, as they can in theory be triggered by things not related to Twitch.

Config.events
Config.eventsForGames

An event looks like this, and contains what was in the previous reward pools, plus options that will support future developments.

{
    options: { ... },
    triggers: {
        command: { ... },
        reward: { ... }
    },
    actions: { ... }
}

To see how to actually populate these, or to extend things, check the new config template files referenced at the top of this section.

New Features

Does this section go here? Or before config changes? Who knows, this is how it is this time anyway.

Raiding

There are now raid commands! They are part of the commands config template, but in short you can initiate a raid if you run !raid tag|name|link, or !unraid to cancel a raid. For this to work you need to regenerate your channel token with this additional scope: channel:manage:raids

Command Variations

For keys used for commands, you can now provide alternatives, so instead of just say as value, you can do say|talk|speak and any of those will trigger the provided actions now.

Text Tags

The tag replacement system has been expanded a lot, check the wiki page for Text Tags to see all the current options.

Game

With the above mentioned tag updates, the !game command is now possible to build entirely with the tag replacement feature. The default hard-coded command has as such been moved into the commands config template.

Cheer Trigger

It is now possible to trigger events on someone cheering a specific amount of bits in the channel. Set a cheer trigger for an event.

Say

Just like with the game reward, the !say command can now easily be done with the text tags, so it has been moved to a custom command and is also available in the commands config template.

TTS Set Voice

This reward is now more lenient when matching language or country for a TTS voice, it will do a best guess match and use that to select a voice, so you an input like kr should give you Korean, and sv should give you Swedish. There has been plans to transition TTS settings to an action, so it can also be used with commands, but that work has been delayed but the heat wave we've had. Brain no werx.