Giter VIP home page Giter VIP logo

twitch-tui's Introduction

twitch-tui

Twitch chat in the terminal.

crates CI pre-commit.ci status unsafe

Feature list

  • Read/send/search messages
  • Switch channels
  • Create and toggle filters
  • Command, channel, and mention suggestions
  • Customize functionality and looks to your liking using a config file

Links

More information

If you have any problems, do not hesitate to submit an issue.

Combine this application with streamlink to rid the need of a browser while watching streams.

This project follows the guidelines of Semantic Versioning.

twitch-tui's People

Contributors

balroggg avatar dependabot[bot] avatar enthusiastmartin avatar gdwr avatar kosayoda avatar kshpin avatar modprog avatar nadhum avatar nogesma avatar pre-commit-ci[bot] avatar tgharib avatar vesdev avatar xithrius avatar yokann 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitch-tui's Issues

Too many unwraps.

This repository is littered with .unwraps() here and there. Clean them all up and do some actual error handling.

Side bar for user followers

Add a sidebar to the left (like Twitch's website) to see who's live, and who's offline.

No matter the state of the followed user, they list should be able to be scrolled through, and then some action will be taken to enter the chat.

Panicked at tokio::select

Sometimes app panicked at tokio::select, app does not get any messages.

thread 'tokio-runtime-worker' panicked at 'all branches are disabled and there is no else branch', src/twitch.rs:56

git commit a4e26b3

Integration with `streamlink`.

streamlink allows users to watch streams through their favorite media player, such as vlc.

Since streamlink has a PyPI packge, it should be possible to launch streamlink on startup of twitch-tui.

Given the level of integration streamlink's Python package allows, more features such as starting/stopping/restarting streamlink with keybinds on twitch-tui could have implementations.

PyO3 is the solution for the connection.

Listing users.

Seeing who's in chat within a different window, either to a side of the main chat window, or layered.

Cycle through different chats.

Cycle through different chats by Ctrl + Tab to move right through the tabs, and Ctrl + Shift + Tab to go left.

Ctrl + 1 through Ctrl + 0 should also be possible, to swap between 10 different chat windows.

Make sure the optimization of thread usage and message storage is viable so we don't hit CPU usage like shown in #31.

Roadmap.

Highest priority at the top, lowest at the bottom.

  • GitHub Workflows.
  • Precommit.
  • Dependabot.
  • Scrolling:
    • Auto
    • Manual
      • Bold text on selection
      • Actions on select (copy text, delete message, etc)
  • #7
  • #10
  • #14
  • Seeing who's in chat in a different window.
  • Document everything.
  • Command suggestions (if possible).
  • #17
  • Cycle through different chats by ctrl + tab and ctrl + shift + tab for right/left movement.
  • Unit test as much as necessary.

Filtering messages with regex.

Some content just never wants to be seen by the user.

An sqlite file will be used so filters can be managed.

A popup window should also be used so the user can read/write filters.

This keybind shouldn't be too easy to reach since filters can contain quite abrasive inputs. If another person is watching the user's screen, said keybind wouldn't be desirable to hit accidentally.

Add rustdoc documentation.

Use rustdoc to generate more in-depth documentation for this binary.

This will be needed for 2.0 due to the amount of features that will be had.

This will be had in 2.1, since the README will suffice for now.

Manual scrolling.

Implementation:

  • Allow the user to scroll through messages, being with the scroll wheel, up/down arrow keys, and even j or k.
  • When scrolling through messages, the currently selected one should be bold.
  • Allow user and moderator actions on a selected message such as copy and delete (if possible).

There are different users within Twitch, and then subsets of those users. Let's try to find a way to cater to all of them, either through different options in the config file or general-purpose manual scrolling. Given that someone has gone out of their way to download and setup the binary of this program, we can assume that they're most likely willing to either read large chunks of chat or freeze every so often to see if a message really is what they saw.

Implementation suggestions as of now when manual scrolling mode is activated for the chat:

  • The new messages get stored in the VecDeque for later viewing. Once the user exists out of manual scrolling mode (which only gives the previously configured amount of messages backwards, stored in config.terminal.maximum_messages), they get to see the most recent messages as a whole.
  • An amount of config.terminal.maximum_messages / 2 as a floored float are available backwards and forwards (for new messages). Once new messages appear, there are two options:
    • Remove messages from the back of the VecDeque so there's room for new messages.
    • Use a different data structure (if needed) to allow for adjust the amount of messages to be stored in the front, so all new messages are available while only some backwards are.

For channel and user searching, a function will be created to go through the items. The popup window will not expand beyond a certain point.

TODO:

  • Chat
  • Users
  • Channels

Usernames in lowercase

Only Twitch username with uppercase letter, all others(like channel bot and users) in lowercase.

Expected: usernames can have both lowercase and uppercase letters

Add support of twitch badges

We have no support of twitch badges, we can not differentiate users in chat.

Will be good to support this behavior by adding badges like in stream chat.

Possible steps to solve the issue:

  • Add config/cli argument to enable/disable showing badges(badges = on/off)
  • Get badge status (mods/subs/prime or others)
  • Render badges by Unicode emotes

Fix infinite scrolling backwards.

Currently, the main branch allows for scrolling behind the last message.

This shouldn't be possible, since although the user can reset the scroll back to 0, it can be pretty annoying when just wanting to scroll all the way back to the first message, then going past it.

First time startup.

During first time setup, user should be prompted for what they want in their config, along with an entry for their Twitch token.

There should also be an option to not have the config be generated at all.

Perhaps different templates, such as minimal and maximum items on screen.

Fuzzy search previous channels.

Users may switch channels often, between their favorite streamers. This feature allows them to go back to previous channels quickly.

An sqlite database shall be used for previous channels. It will be placed in ~/.config/twt/channels.db on MacOs/Linux and %appdata%\twt\channels.db on Windows.

This issue relies on #67.

Regex search usernames

A popup window for filtering out usernames and their messages.

Probably useful for moderation.

Passing a channel's name as an argument for overriding channel in config.toml

Hi! I've been using twt for a bit now and i felt the need to be able to override the channel property inside config.toml, since having to alter the file every time i wanted to switch channels was getting a bit cumbersome. So i hacked something real quick on my machine to achieve that:

let mut cloned_config; 
let ui_config;

if env::args().len() > 1 {
    let args: Vec<String> = env::args().collect();
    let channel: String = args[1].clone();
    cloned_config = config.clone();
    cloned_config.twitch.channel = channel;
    ui_config = cloned_config.clone();
} else {
    cloned_config = config.clone();
    ui_config = cloned_config.clone();
}

So, i was wandering... would having this as an offical feature for twt be of interest? If so, i think i could contribute with that. Not with the code above of course, i hacked that real quick and prior to that i had no experience with Rust, i'd have to take some time to study and then contribute. Many thanks for the software! :)

Time since message.

Instead of having the regular date and time, have a date/time delta to show how long it's been since a message was sent.

Add `--debug` flag.

Opens a window to the right of the chat to debug the application.

Relies in #34, so values can be scrolled through.

Regex search messages.

Did you see a message that you'd like to copy or get the context of?

Search in regex or just regular text (because regex allows that) to acquire the context of said message, and have it highlighted.

Other keybinds such as message deletion will also be implemented.

Relies on #34.

Polling to eliminate busy waiting.

The event handler for listening for any keystrokes is currently contained within an infinite loop with no delay.

This causes busy waiting, which means the thread handling keys is still processing, waiting for a key to be hit.

Using the polling crate, this problem can be avoided, and less computer resources can be taken.

Often at startup, twitch-tui does not connect and does not throw any error

Describe the bug:
This is a hard bug to describe as it's not persistent, and can't be accuratly reproduced.

The best I've got is that sometimes, when loading twt, it fails to connect to the chat, without throwing any error - I only see an empty list with the "Time / Username / Message content" header.

To Reproduce:
No good way to reproduce unfortunately.

Screenshots:
image

System:
Mac OS 12.2.1

  • Twitch-tui version:
    1.6.0

  • Terminal:
    iTerm2 3.4.15

  • Shell:
    zsh

Generate config if one doesn't exist.

The user shouldn't have to copy over the config themselves from this repository.

If the folder(s) do not exist, default-config.toml should be copied to the correct path, such as ~/.config/twt/config.toml on Linux/MacOS, or %appdata%\twt\config.toml on Windows.

Build on nightly failed

Probably not important, but easy to fix.

Build on nightly failed (1.62.0-nightly (f4ec0e7cf 2022-04-22))

cargo +nightly c
    Checking twitch-tui v2.0.0-alpha.3 (/home/balrog/src/twitch-tui)
error[E0283]: type annotations needed
  --> src/ui/mod.rs:62:35

Possible fix:

diff --git a/src/ui/mod.rs b/src/ui/mod.rs
index f32f5b7..681b8e3 100644
--- a/src/ui/mod.rs
+++ b/src/ui/mod.rs
@@ -51,7 +51,7 @@ pub fn draw_ui<T: Backend>(frame: &mut Frame<T>, app: &mut App, config: &Complet
     let vertical_chunks = Layout::default()
         .direction(Direction::Vertical)
         .margin(margin)
-        .constraints(vertical_chunk_constraints.as_ref())
+        .constraints(vertical_chunk_constraints.as_slice())
         .split(frame.size());

Replace rusqlite with JSON.

The sqlite database is not needed, due to it being hard for users to modify any data or see it easily.

It would be faster to read/write to memory instead of storage during runtime, and using JSON would make it much easier to implement methods for filters, and recently switched to channels.

Config files/directories don't get generated

Describe the bug:

In step 3, from the README, it says that the default configuration paths get generated, but that wasn't the case when running it on Windows 10. Instead, this is what I get below.

Configuration not found. Create a config file at 'C:\Users\ME\AppData\Roaming\twt\config.toml', and see 'https://github.com/Xithrius/twitch-tui/blob/main/default-config.toml' for an example configuration.

To Reproduce:

  1. Install twt using cargo install.
  2. Run twt in the terminal, from README step 3.
  3. Go to APPDATA to get to configurations, given the twt directory.

The directory and config file(s) isn't there. I checked all the directories in my ~/AppData, just in case and found nothing. Even checked ~/.config, although this is a Windows machine so there shouldn't be anything there.

Expected behavior:

I expected a directory at %APPDATA%\twt (PowerShell: $env:APPDATA\twt).

Screenshots:

System:

  • Twitch-tui version: 1.6.0
  • Operating System: Windows 10 Pro - Version 10.0.19044 Build 19044
  • Terminal: Windows Terminal
  • Shell: PowerShell

Additional context:
Add any other context about the problem here.

I use the same context on Linux machines, which is why I have directories like ~/.config.

Name mapping.

Allow users to have their names re-mapped to something else. This can be helpful if the user wants to be called something else, but doesn't want to change their username.

Perhaps notes for users could be added in the future. Maybe at that point, rusqlite can be put back, with data dump and purge options, of course.

Will be implemented after 2.0 is released.

Update outdated keybinds window.

Now that PRs such as #32 have been merged, many keybinds have been updated or added.

A list of all keybinds in one window may not be optimal, a different strategy for sorting through descriptions of keys could be used such as tabs of keybinds.

The README of this repository will also have to be updated.

Search for users.

When the user popup from #35 is implemented and a search template for different windows is created, then this should be something to be added.

This issue relies on #67.

Command suggestions.

Moderator actions through slash commands (such as /clear) should be suggested when / looks to be the first character.

If a command isn't valid, it is up to debate whether the incorrect text should be sent to Twitch at all, or if the user should be warned instead.

Switch from `Clap` to `StructOpt`.

Less convoluted documentation and integration with this application.

Here is the documentation.

I'll be putting this into the 2.0 release.

@balroggg I think you brought this up at some point about how clap removed the ability to use a yml config file, so this is the solution.

main.rs and cli.yml will be converted to some structure.

University.

Once again, university has picked up in pace, and I won't be able to focus on this project as often.

Thanks for understanding.

Cargo warning

Warning when build project

cargo c
warning: unused manifest key: target.aarch64-unknown-linux-gnu.linker
   Compiling libc v0.2.119

We can probably remove gcc linker from aarch64 target in Cargo.toml.

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.