SwagLyrics-discord-bot
SwagLyrics-discord-bot copied to clipboard
Add Vibe Mode
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.
Hello @aadibajpai! Thanks for updating this PR.
- In the file
SwagLyricsBot/general_commands.py
:
Line 95:66: W291 trailing whitespace
Comment last updated at 2020-08-20 01:32:12 UTC
Codecov Report
Merging #42 into master will decrease coverage by
1.59%
. The diff coverage is14.51%
.
@@ 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.
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
@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.
@dolphingarlic @fadedcoder review again, thanks!
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
Make logs work (you can't call
add_sub_log
without first callingadd_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?
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
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.
Fine, It can stay then