Xithrius / twitch-tui

Twitch chat in the terminal.
https://xithrius.github.io/twitch-tui/
Apache License 2.0
451 stars 32 forks source link

Subscriber emotes from some channels don't show when I'm the one using them #615

Closed LukyLurks closed 4 months ago

LukyLurks commented 4 months ago

Describe the bug:

To Reproduce: I don't have reliable steps since it's my specific situation. The best I can suggest is:

  1. Be subscribed to at least 2 channels.
  2. Attempt to send messages containing the related subscriber emotes: emotes from one channel may remain in text form when sent.
  3. Attempt to find the subscriber emotes in the popup menu: emotes from one channel may not be found.

Expected behavior:

Screenshots: sshot_2024_06_18_23_25_43

System:

[terminal] delay = 30 maximum_messages = 500 verbose = false first_state = "Dashboard"

[storage] channels = false mentions = false

[filters] enabled = false reversed = false

[frontend] show_datetimes = true datetime_format = "%T" username_shown = true palette = "pastel" title_shown = true margin = 0 badges = true theme = "dark" username_highlight = true state_tabs = false cursor_shape = "user" blinking_cursor = true inverted_scrolling = false show_scroll_offset = false twitch_emotes = true betterttv_emotes = true seventv_emotes = false frankerfacez_emotes = true favorite_channels = [] recent_channel_count = 5 border_type = "plain" hide_chat_border = true right_align_usernames = false show_unsupported_screen_size = true



**Additional context:**
- If this issue is hard to diagnose on your own because you're not subscribed to multiple channels, feel free to ask me to do "technical" stuff. I don't know much about Rust, therefore I'd be happy to have an excuse to get into it.
Xithrius commented 4 months ago

Hello, and thanks for the issue! Before actual diagnosis of code or anything, how did you generate your token?

edit: Oops, I see that you're the same author as #611. I don't think additional scopes are needed, so you did generate your token properly.

Xithrius commented 4 months ago

Might be an issue between the current and previous minor versions of twitch-tui. Could you remove the cache located at ~/.cache/twt? 2.6.11 requires a cleared cache for subscriber emotes to work properly.

LukyLurks commented 4 months ago

I actually generated a different token since. When I noticed the issue I am describing here, I suspected that https://twitchapps.com/tmi/ wasn't giving me enough scopes, so I generated another one with https://twitchtokengenerator.com instead, with the following scopes: chat:edit, chat:read, user:read:chat, user:read:emotes, user:read:follows, user:read:subscriptions, user:write:chat. This is the token used for this bug report, and that I currently use in my config. I also made sure $TWT_TOKEN wasn't set to some old token (it is unset).

Could you remove the cache located at ~/.cache/twt? 2.6.11 requires a cleared cache for subscriber emotes to work properly.

I quit twt, did rm -r ~/.cache/twt/, started twt, and tried to send dekillKermit and search it in the popup menu: the issue persists.

Xithrius commented 4 months ago

Alright, looks like I'll have to dig deeper then.

Xithrius commented 4 months ago

@Nogesma I think #591 might be the cause of this problem, but I'm not 100% sure. If you could give any insight, I'd very much appreciate it.

Besides that, @LukyLurks have you tried other recent versions, such as 2.6.10?

LukyLurks commented 4 months ago
Xithrius commented 4 months ago

Could you do the check for seeing what happens when others send subscriber emotes? Thanks.

Xithrius commented 4 months ago

I also noticed in your config that you have seventv_emotes set to false. I'm not certain that this would fix your issue, but have you tried setting it to true?

Nogesma commented 4 months ago

Before 2.6.11 there wasn't any checks for if users actually could send those emotes, so twt displayed subscriber emotes from the current channel for everyone. I'll try to see if I'm using the wrong api to get subscriber emotes. I'll let you know if I need any more info figuring that one out.

Nogesma commented 4 months ago

I just pushed a draft PR with what I think fixes it, could you please try it?

LukyLurks commented 4 months ago

@Nogesma It seems to be working. The emotes appear in the popup search, and they show correctly when I send them. When other people send subscriber emotes (both from the current channel and different channels) it shows correctly too.

@Xithrius

Thank you both!

Xithrius commented 4 months ago

Thank you so much for going through each version for testing. I'll be testing the PR myself later today, and if all is good then I'll do a release as soon as I can once it's merged.

Xithrius commented 4 months ago

Fix available in https://github.com/Xithrius/twitch-tui/releases/tag/v2.6.13

Xithrius commented 4 months ago

Thank you @LukyLurks for the issue, and @Nogesma for the fix!