Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a standardised way for scrobbling from bots #283

Open
CyberFlameGO opened this issue Jun 6, 2024 · 2 comments
Open

Include a standardised way for scrobbling from bots #283

CyberFlameGO opened this issue Jun 6, 2024 · 2 comments

Comments

@CyberFlameGO
Copy link
Contributor

Currently, tracks being played by bots are only scrobbled if the music bot's track-playing format is hardcoded into the bot, which is limiting for people self-hosting music bots - my suggestion is to either add formats for well-known self-hostable music bots (with a configurable bot ID per server), or as a more complex solution, allow servers to configure (via regex or a now-playing format builder) formats that FM Bot should listen for from a bot ID.

@th0mk
Copy link
Member

th0mk commented Jun 6, 2024

Someone was recently working on a PR for this, I wrote my feedback on that here: #268 (review)

For Red music bot it would work like this:

So for example we can determine if a music bot is Red by:

  • The name starts with 'red'
  • Or it has a role called 'red music bot'

Doing a role check is fairly straightforward, for example:

if (context.User is IGuildUser guildUser)
{
    var role = context.Guild.Roles.FirstOrDefault(x => string.Equals(x.Name, "red music bot", StringComparison.OrdinalIgnoreCase));
    if (role != null && guildUser.RoleIds.Contains(role.Id))
    {
        
    }
}

A role is easy to add for any server staff and it would still allow custom names for the bot itself.

@CyberFlameGO
Copy link
Contributor Author

Ohh, I was looking at that PR and it seemed a bit stale - that is pretty similar to what I had in mind for my suggestion though there are a couple more popular self-hostable bots out in the wild; JMusicBot comes to mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants