Skip to content

Twitch bot which create a queue for Mario Maker 2 Levels from chat, with a GUI

License

Notifications You must be signed in to change notification settings

tomaarsen/TwitchMMLevelQueueGUI

Repository files navigation

TwitchMMLevelQueueGUI

Twitch bot which create a queue for Mario Maker 2 Levels from chat, with a GUI


Explanation

When the bot has started, it will open up this GUI:

image

The bot connected to this GUI will, when "Run" is pressed, allow chat members to add their levels to a queue. When the streamer wishes to play a level, they can play the first level of the queue. This level will also be available for chatters to access by the use of a command.

In short, this bot allows streamers to fairly pick chat levels with just one click.

This bot is similar to my Twitch Mario Maker Level Picker. However, the bot in this repository uses a queue that does not give advantages to subscribers, while the Level Picker semi-randomly picks levels from the list of all added levels, giving better odds to people who have been subscribed for longer.


Commands

!addlevel XXX-XXX-XXX
  • Adds the level with code XXX-XXX-XXX to the queue.
  • Anyone can use this.

!nextlevel
  • Changes the current level to the next level.
  • Anyone with the allowed rank can use this. (See Settings for more information)

!level/!current/!currentlevel
  • Shows the creator and code of the current level in the chat.
  • Anyone can use this.

!clearlevel
  • Clears the queue of levels
  • Anyone with the allowed rank can use this. (See Settings for more information)

!levelhelp/!helplevel
  • Shows information about the commands everyone can use.
  • Anyone can use this.

!queue
  • Shows where the user is in the queue.
  • Anyone can use this.

Settings

This bot is controlled by a settings.txt file, which looks like:

{
    "Host": "irc.chat.twitch.tv",
    "Port": 6667,
    "Channel": "#<channel>",
    "Nickname": "<name>",
    "Authentication": "oauth:<auth>",
    "AllowedRanks": [
        "broadcaster",
        "moderator"
    ],
    "AllowedPeople": []
}
Parameter Meaning Example
Host The URL that will be used. Do not change. "irc.chat.twitch.tv"
Port The Port that will be used. Do not change. 6667
Channel The Channel that will be connected to. "#CubieDev"
Nickname The Username of the bot account. "CubieB0T"
Authentication The OAuth token for the bot account. "oauth:pivogip8ybletucqdz4pkhag6itbax"
AllowedRanks List of ranks required to be able to perform the commands. ["broadcaster", "moderator"]
AllowedPeople List of users who, even if they don't have the right ranks, will be allowed to perform the commands. ["cubiedev"]

Note that the example OAuth token is not an actual token, but merely a generated string to give an indication what it might look like.

I got my real OAuth token from https://twitchapps.com/tmi/.


GUI

For reference, this is the GUI:

image

Let's clarify the functionality from the GUI:

Button Action
Auth This button will hide or unhide your Authentication token. This way you can hide it when you aren't changing it, so that it will not leak.
Run This button is both "Stop" and "Run" at the same time. When the bot is running, the button will say Stop. While it is not, it will display "Run". Pressing this button will either stop the bot from running, or start the bot using the information filled in above.
Move to Next Level Equivalent to typing !nextlevel in chat. Picks the next level.
Clear: Clears the list of levels. The date shows when the list of levels was last cleared.

In addition to these buttons, there is a textbox which will automatically fill with chat levels. This textbox represents the queue. The #1 item in the queue will be the current level used by !currentlevel, and shows up as bold.


Requirements

Among these modules is my own TwitchWebsocket wrapper, which makes making a Twitch chat bot a lot easier. This repository can be seen as an implementation using this wrapper.


Other Twitch Bots

About

Twitch bot which create a queue for Mario Maker 2 Levels from chat, with a GUI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages