Git Product home page Git Product logo

oxidizebot's Introduction


Site ๐ŸŒ โ€“ Command Help โ“

oxidize

github build status chat on discord

A high performance Twitch Bot powered by Rust.


Features

Commands โ€” Aliases, custom commands, promotions, plus a bunch more.

If there's something you're missing, feel free to open an issue.

Rust โ€” Written in Rust, promoting high performance, low utilization, and reliability.

Configurable โ€” Everything is tweakable to suit your needs through a hundred settings. Changes to settings applies immediately - no need to restart.

Integrated with Windows โ€” Runs in the background with a System Tray. Notifies you on issues. Starts automatically with Windows if you want it to.


Installing and Running

You can download an installer or an archive from releases or build the project yourself.


Building

You'll need Rust and a working compiler: https://rustup.rs/.

After this, you build the project using cargo:

cargo build

If you want to run it directly from the project directory, you can do:

cargo run

If you want to run the bot with the most amount of diagnostics possible, you can do the following:

env RUST_BACKTRACE=1 cargo +nightly run -- --log oxidize=trace

This will include backtraces on errors, which is currently an unstable feature.


License

OxidizeBot is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

oxidizebot's People

Contributors

dependabot[bot] avatar osurce avatar pavelpilar avatar sikarii avatar udoprog avatar zoes17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

oxidizebot's Issues

Sync the state of the remote player

With the new connect-based player, the player is immediately paused when it starts up to get into a consistent state.

We could instead poll the state of the player, and use that to initialize the bot state.

Flatten configuration further

Completely remove [[irc.channel]] in favor of a [irc] channel argument.

Move currency configuration to root of config.

We can now only configure the bot to be present in a single channel.

Add a page to the web UI to show song list

Given the character limit per message in chat, it would be good if I could see the full song list via the web UI.
It would also be easier to read given everything is basically one big paragraph in Twitch chat.

Attempt to automatically refresh expired tokens on startup

To reduce the amount of times we need to authorize the bot we can try to attempt to refresh the token using the stored refresh token.

This doesn't have an explicit expiration time, so we catch any error that occurs during the refresh phase and treat it as a failure.

Implement better shuffling

The shuffling is currently fully randomized and will probably pick the same song over and over.

Instead we should implement a shuffle that builds a queue out of all the shuffled fallback items to make sure every song plays at least once.

CC: @Jqnxyz @osurce

Create a !time command

Outputs something like:

The time for the streamer is 08:41 CEST

With the following settings:

  • time/enabled - if the command is enabled.
  • time/timezone - the timezone that the time command should output.
  • time/template - the template that the command should respond with.

Web-based overlay

Implement a web-based overlay to replace the write-to-file approach with a richer experience.

Modules that need to be implemented:

  • Current song
  • Countdown

Testing

To test out this feature, you can run setmod from the project directory like this:

path/to/setmod/tools/setmod.ps1 -WebRoot path/to/setmod/bot/web

The web content will eventually be bundled in the bot so we don't have to specify a separate web root. But this is currently used to ease development.

Then navigate to https://localhost:12345/overlay

!song close/open does not provide confirmation response

Performing !song close or !song open commands does not provide the user with a confirmation that the song queue has closed/opened. This may cause concern that the bot may be broken and/or the command did not register.

Make volume into a setting

Volume can currently only be set through configuration. This should be a setting so that it is persisted across restarts.

Mentoring Instructions

Note that this would require a setting per player:

  • player/spotify/volume
  • player/youtube/volume

You have to add a schema for it here:
https://github.com/udoprog/setmod/blob/master/bot/src/settings.yaml

Calling !song volume should only manipulate the setting of the currently active player. This is tracked here:
https://github.com/udoprog/setmod/blob/master/bot/src/player.rs#L1490

!song volume translate to the Command::Volume command defined here following :
https://github.com/udoprog/setmod/blob/master/bot/src/player.rs#L179

Which is processed here:
https://github.com/udoprog/setmod/blob/master/bot/src/player.rs#L1735

The trickiest part here is that we would have to subscribe to a stream of updates. This is done through the init_and_stream function, and there are a few examples of it in the codebase.

Expand echo_current_song setting

Currently "echo_current_song" only allows for true/false.
It would be good if it had something like "commands_only" meaning that it will echo if it's the result of a command in chat (e.g. !skip), but it won't echo by itself at the end of a track.

Support promotions

Promotions are messages which are posted to the channel at regular interval.

Promote Song

Would love the ability to promote songs to play next.
Example: !song promote 7 (this would promote the song that's #7 in the queue to play next).

Remove all `is_moderator` check in favor of scopes

These checks are otherwise hard-coded and make it hard to test different authorization combinations.

Instances that should be replaced are:

bot/src/command.rs:77:        if self.is_moderator() {
bot/src/command.rs:125:    pub fn is_moderator(&self) -> bool {
bot/src/command.rs:164:        if !self.is_moderator() {
bot/src/irc.rs:648:                            if ctx.is_moderator() {
bot/src/irc/currency_admin.rs:234:                if ctx.is_moderator() {
bot/src/module/song.rs:52:        let is_moderator = ctx.is_moderator();
bot/src/module/song.rs:124:            if subscriber_only && !is_moderator {
bot/src/module/song.rs:150:                    is_moderator,
bot/src/player.rs:863:        is_moderator: bool,
bot/src/player.rs:871:            if !is_moderator {
bot/src/player.rs:918:        if !is_moderator {
bot/src/player.rs:947:        if !is_moderator && user_count >= max_songs_per_user {

They should each be replaced with a scope, like:

if ctx.has_scope(auth::Scope::BypassPlayerConstraints)) {
}

That allows us to test these scopes by tweaking them in the Authorization tab.

Get streamer identity from Twitch token

twitch token should include login of who it belongs to. Use this in place of streamer configuraiton key.

Alternatively it might be possible to fall back on [irc] channel and strip the hash prefix.

Add ability to detach player

In case you want the bot to run, but not control your local Spotify player you should be able to detach the player so it is no longer controlled by the bot.

CC: @louis6321

Cooldown of moderator commands (!song skip)

Multiple moderators might run !song skip at the same time, skipping too many songs.

Introduce a cooldown to prevent this, so that you can only e.g. skip songs every N seconds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.