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

[API PROPOSAL] Allow/Deny list #2210

Open
1 task done
pwall2222 opened this issue Feb 26, 2024 · 8 comments
Open
1 task done

[API PROPOSAL] Allow/Deny list #2210

pwall2222 opened this issue Feb 26, 2024 · 8 comments

Comments

@pwall2222
Copy link
Contributor

pwall2222 commented Feb 26, 2024

Content

So, I was on the Vencord discord server, and brought an idea for a plugin.
An allow/deny list for the NoReply plugin, which brought @Sqaaakoi to comment that there should be an API.

I decided to bring it upon myself to create such request, which since I've kinda dealt with this issue in the past I wanna try my best to help.

Since my original proposal only centered around users this bit is new:

List types

  • User
  • Guild
  • Channel

The guild and channel lists would be just simple lists, containing the IDs for them.

User lists

The user lists oughta be one of the more complex ones because you might want to add more filtering than just by selecting a single user, my proposal is

Allow/Deny listing:

  • By ID
  • By Name Substring
  • By Guild Role

Priority

I think a sensible priority would be:

ID > Name > Guild Role

Since we want to always respect user decision first, then the most notable part of the personalization (people forget changing their roles a lot), roles and then default.

UI Helper

As per the github thread, this could be a UI helper, where you define the lists and it gets automatically added to their respective context menus, (guild, user).

Vendicated example:

Context menu with add to list button

Too much clutter

As it was mentioned, if plugins are gonna have one submenu only containing one list, it would be kindoff annoying to navigate and unecessary.

Since all the plugins are all in-house we could just have a defined set of categories so that they fit nicely, or have plugins with only one entry be shown without a submenu.

API Examples

Vendicated example:

const lists = defineLists({
	userWhitelist: {
		type: "user",
		name: "Users to log messages from"
	}
})

const isUsedWhitelisted = lists.userWhitelist.includes(someId);

Request Agreement

  • I have read the requirements for opening an issue above
@Sqaaakoi
Copy link
Contributor

When I mentioned API, I was also thinking

  • Settings component for managing these lists (maybe we could steal FriendRow or the report menu user component as it has a button)
  • Auto-generated context (sub)menu on users (and roles) to manage them being in lists

I am not sure how it would be stored, but I think storing roles should be separate from the list of users

@Kyuuhachi
Copy link
Contributor

I think the default parameter sounds pretty useless — just do isUserListed(userId) ?? true.

Also if there's a context menu, that would require users of such lists to be registered somehow so that you can choose which filter to add them to. Not necessarily an issue, but needs to be addressed.

@Vendicated
Copy link
Owner

yep we already discussed about this in the past

my basic idea was to allow plugins to define white-/blacklists with a function similar to defineSettings:

const lists = defineLists({
	userWhitelist: {
		type: "user",
		name: "Users to log messages from"
	}
})

const isUsedWhitelisted = lists.userWhitelist.includes(someId);

this would then automatically add a context menu and settings ui for you and
image

@Sqaaakoi
Copy link
Contributor

yep we already discussed about this in the past

my basic idea was to allow plugins to define white-/blacklists with a function similar to defineSettings:

const lists = defineLists({
	userWhitelist: {
		type: "user",
		name: "Users to log messages from"
	}
})

const isUsedWhitelisted = lists.userWhitelist.includes(someId);

this would then automatically add a context menu and settings ui for you and image

This is almost exactly what I was thinking.
I was expecting it to be a part of the plugin settings directly though, and also I don't think 2 level deep submenus are a good idea, especially if they only have 1 or 2 options inside

@pwall2222
Copy link
Contributor Author

I will do a touch-up and edit the issue with a better formed idea taking into account what was said.

@Vendicated
Copy link
Owner

and also I don't think 2 level deep submenus are a good idea, especially if they only have 1 or 2 options inside

sure, but a looooong menu like this is an awful idea too. thus, doubly nested is way better imo
image

@Sqaaakoi
Copy link
Contributor

and also I don't think 2 level deep submenus are a good idea, especially if they only have 1 or 2 options inside

sure, but a looooong menu like this is an awful idea too. thus, doubly nested is way better imo image

i never meant have them all at the root level menu, i mean have one submenu for all the list toggles

also yes that menu is disgusting

@TheOnlyWayUp
Copy link

yep we already discussed about this in the past

my basic idea was to allow plugins to define white-/blacklists with a function similar to defineSettings:

const lists = defineLists({
	userWhitelist: {
		type: "user",
		name: "Users to log messages from"
	}
})

const isUsedWhitelisted = lists.userWhitelist.includes(someId);

this would then automatically add a context menu and settings ui for you and image

Hi, I'm interested in contributing to this @Vendicated

Is this the issue tracking the per-plugin whitelist/blacklists?

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

No branches or pull requests

5 participants