SwagLyrics-discord-bot icon indicating copy to clipboard operation
SwagLyrics-discord-bot copied to clipboard

Add Vibe Mode

Open aadibajpai opened this issue 4 years ago • 9 comments

Implements an automatic loop so you do not need to request lyrics again and again if the song changes, until you stop listening to music or use the $kill command.

This is similar to the way it works in the cli swaglyrics application.

aadibajpai avatar Jul 26 '20 02:07 aadibajpai

Hello @aadibajpai! Thanks for updating this PR.

Line 95:66: W291 trailing whitespace

Comment last updated at 2020-08-20 01:32:12 UTC

pep8speaks avatar Jul 26 '20 02:07 pep8speaks

Codecov Report

Merging #42 into master will decrease coverage by 1.59%. The diff coverage is 14.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
- Coverage   28.70%   27.11%   -1.60%     
==========================================
  Files           9        9              
  Lines         310      354      +44     
==========================================
+ Hits           89       96       +7     
- Misses        221      258      +37     
Impacted Files Coverage Δ
SwagLyricsBot/lyrics.py 21.87% <0.00%> (ø)
SwagLyricsBot/general_commands.py 35.32% <14.75%> (-6.95%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9232d96...b39c037. Read the comment docs.

codecov[bot] avatar Jul 26 '20 02:07 codecov[bot]

Well, I know you said it's not going to work with more users, but this approach is a no-go. Using self statement makes it almost impossible to make it work for more users.

fixed

aadibajpai avatar Jul 29 '20 22:07 aadibajpai

@thealphadollar, this adds a looping feature to the bot, where you once call the commands and it will keep sending lyrics as activity changes until you stop listening or kill the loop with $kill. The logic is that the $vibe command adds your info to a shared variable and starts a loop if the loop isn't already running. And then the loop every 5s takes care of all the users in the shared variable and $kill removes your info from the shared variable.

There's a bunch of debug print statements there but I'll get rid of them.

aadibajpai avatar Jul 29 '20 22:07 aadibajpai

@dolphingarlic @fadedcoder review again, thanks!

aadibajpai avatar Jul 29 '20 22:07 aadibajpai

Make logs work (you can't call add_sub_log without first calling add_log) + clean up console output, and make sure it works independently for every user, also I think this option should be only called on direct messages

flabbet avatar Aug 06 '20 17:08 flabbet

Make logs work (you can't call add_sub_log without first calling add_log) + clean up console output, and make sure it works independently for every user, also I think this option should be only called on direct messages

check now, also how much console output would you like to keep so it's okay?

aadibajpai avatar Aug 09 '20 08:08 aadibajpai

Well, it's too much same information for one loop, get rid of it, it should print maybe ony a user name + song name. And get rid of the slang. Use casual language, but not slang. It's not consistent for the rest of the bot and I will not merge it until you change it. I let you leave $vibe as a command string, but provide aliases like $loop, and describe it in $help image

Oh and fix the conflict

the Spotify thing happens through the logging set up in the preexisting function, so I'm not modifying that. Rest everything has been addressed.

aadibajpai avatar Aug 20 '20 01:08 aadibajpai

Fine, It can stay then

flabbet avatar Aug 23 '20 14:08 flabbet