Just-Some-Bots / MusicBot

:musical_note: The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)
https://just-some-bots.github.io/MusicBot/
MIT License
3.11k stars 2.35k forks source link

Output debug into selected text channel. #1589

Closed SeasonalFerret closed 5 years ago

SeasonalFerret commented 6 years ago

Please tick all applicable boxes.

Which version are you using?

What type of issue are you creating?


Feature request

ipfvy7v 1

Allow a setting in options.ini to output the console into a selected text channel. This would allow server owners (and others with permission) to view the bot's output, so that they can understand who played what song and any errors.

My server has a dedicated text channel used for bots. In it is a log of stuff that bots log, such as when a user joins the server, message deletion reasons, etc. Not being able to set MusicBot to output the log into a logging channel was actually quite surprising, as I was looking for the specific setting for a bit before giving up.

Since my bot is hosted in a VPS, I do not wish to constantly ssh into the server just to check the logs. Being able to see what's happening, if something goes wrong, and if someone's been naughty with the bot inside of discord would be super helpful, as it is with the other bots on my server.

Bot logging to these servers should be limited to INFO, but should be changable in config.ini. It would be nice to also be able to change the logging info in-chat, something like ?log WARNING or something - restricted to the bot owner, of course.

To help not spam Discord's API, I'd like to suggest a method to send the output in grouped packages instead of instantly. Bot logs something in console -> Bot waits 3 seconds to see if something else becomes logged. If nothing else gets logged after the 3 seconds, or 10 seconds passes, output all of the log into the selected output channel with the separate outputs separated by \n.

PS: Is there a logging setting to only output what users request what songs? If not, it may be interesting to have the bot only output what songs are requested by what users (and maybe other commands) in the logging channel, instead of all of console output. We could even make proper warnings / errors @ the bot owner in emergencies.

ImthePeach commented 6 years ago

This is kind of already built into the bot in a way. Selecting yes on NowPlayingMentions in the options file (https://github.com/Just-Some-Bots/MusicBot/blob/master/config/example_options.ini#L83-L84) will always say "Now playing requested by " Selecting no on DeleteMessages will keep the bot from deleting it's own messages, and if you select no on DeleteInvoking it will keep the song requester's message while selecting yes for this option will simply keep that channel slightly cleaner. (https://github.com/Just-Some-Bots/MusicBot/blob/master/config/example_options.ini#L101-L106)

Example of how this looks: image

SeasonalFerret commented 6 years ago

I want to lot what songs were requested in a separate channel not visible to other users, as well as output any errors.

On Mon, Jun 4, 2018, 8:21 AM Peach notifications@github.com wrote:

This is kind of already built into the bot in a way. Selecting yes on NowPlayingMentions in the options file ( https://github.com/Just-Some-Bots/MusicBot/blob/master/config/example_options.ini#L83-L84) will always say "Now playing requested by " Selecting no on DeleteMessages will keep the bot from deleting it's own messages, and if you select no on DeleteInvoking it will keep the song requester's message while selecting yes for this option will simply keep that channel slightly cleaner. ( https://github.com/Just-Some-Bots/MusicBot/blob/master/config/example_options.ini#L101-L106 )

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Just-Some-Bots/MusicBot/issues/1589#issuecomment-394352214, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ-mW9vCK2mO6phwz-qjovNPRSRxCtsPks5t5TRxgaJpZM4TcJ_m .

AutumnClove commented 5 years ago

Closing because @TheerapakG implemented it. Might not be merged until a later time.