Just-Some-Bots / MusicBot

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

Add people to "User Blocklist" without pinging them #2399

Closed BgueC6595 closed 1 month ago

BgueC6595 commented 2 months ago

What new feature would you like to see?

Pinging requires the person to be in the server. Doing <@123456789123456789> with the user ID does result in a "ping" but the bot spits out an error message in this case

[ERROR:bot] Exception in on_message
Traceback (most recent call last):
  File "/root/MusicBot/musicbot/bot.py", line 6869, in on_message
    response = await handler(**handler_kwargs)
  File "/root/MusicBot/musicbot/bot.py", line 2691, in cmd_blockuser
    if option in ["+", "add"] and self.config.user_blocklist.is_blocked(user):
  File "/root/MusicBot/musicbot/config.py", line 1974, in is_blocked
    user_id = str(user.id)
AttributeError: 'NoneType' object has no attribute 'id'

I haven't tested if this error persists if you do the <@id> trick in a channel that a user does not have access to, but they're a member of the server otherwise.

It would be nice if we were able to do this without pinging people. Either with just usernames (e.g. !blockuser + user_name123) or user IDs (!blockuser + 123456789123456789). Not to mention, not pinging people is far less confrontational.

I will also say it would be nice if there was a way for certain users (with perms) to check the block list. Currently there's no way for a non-host user to know what the block list looks like. At the very least it would be cool if doing !blockuser [user] (without +/-) would tell if you that user was blocked or not.

Which of these categories fit your request?

None

Just checking...

BabyBoySnow commented 2 months ago

I like this, and have added the planned label :) thanks for the request! You should be able to do it in a channel the user doesn't have read access to without pinging them. Also worth mentioning that there is a lot of planned stuffed coming to the dev branch here soon. I'm not sure if this in there already but we'll take a look and if it's not this will be added!