matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
791 stars 148 forks source link

Command on Discord to list users on Matrix #853

Open SethFalco opened 1 year ago

SethFalco commented 1 year ago

Is your feature request related to a problem? Please describe.

Some Discord users get wary about who has access to the messages they send. While it may be a public community, they'd like to be able to query a list of users on the Matrix side since it's not visible otherwise.

Describe the solution you'd like

A command should be added to the Discord bot which lists members of the Matrix chat room.

The response should include a list of all users in the chat which aren't puppeted from the Discord channel the command was received from.

I think it may be worth adding a note that the list is users in the chat room, not in the space. I don't think this should be explained in-depth in the bot message, but it could be nice if it was linked to something that the explained the difference and how it works for particularly interested.

This is so Discord users don't get confused when the list changes between channels.

Command

!matrix listusers

Output

Users in #channel-mention from Matrix may not necessarily be in other channels on the server.

* Seth (@ sethi:one.ems.host)

Describe alternatives you've considered

Can't think of anything else that wouldn't be against Discord ToS.

Miepee commented 1 year ago

The "More info" link could lead to here: https://joinmatrix.org/guide/matrix-vs-discord/#server-vs-space

Not sure if just pumping all users out via text is a good idea. #help:t2bot.io for example, has currently ~1.2k users. Asking for that info on the bridged discord channel would very quickly lead to spam, and you'd probably also have to trim the message if it grows bigger than 2k chars, due to discords message limit.

SethFalco commented 1 year ago

Ahh, valid. 🤔

I would still see value in this for smaller communities, but do appreciate the concern with many users. Perhaps a middle ground could just be to display up to 16, then after that:

and 110 others…

Similar to the UI of Element. This way it'll work very well for smaller chat rooms, and at least be informative for larger ones.

image

In the config, someone hosting the bridge could configure how many entries will appear there.

Miepee commented 1 year ago

Would it be possible for lots of users (or if the message exceeds 2k chars) to just send a file instead? Just have the same "top message", but instead for the rest of the message to list all users, it just sends a text file with all the users instead.

SethFalco commented 1 year ago

That would work, but it might make for a clunky experience for Discord users, I think. Though I guess at some point Discord added a way to preview files in chat, so they don't have to be downloaded, right? (I'm not a Discord user anymore, so not sure of the specifics of this.)

I do think it'd best if users didn't have to download or access external links to read the output of the command, but so long as it will be displayed or previewed in the Discord client, anything goes.

Miepee commented 1 year ago

Though I guess Discord added at some point a way to preview files in chat, so they don't have to be downloaded, right?

Yep.

SethFalco commented 1 year ago

Updating the original request to not have masked links in it. Forgot that normal messages on Discord can't have masked links, to circumvent this one could use embeds to send the message instead, but then we'd need to worry about guilds/users that have embeds disabled.

It's easier to just avoid masked links entirely.

Meanwhile here is a WIP: image

I'll open a draft PR later to get feedback going already.

Miepee commented 1 year ago

Forgot that normal messages on Discord can't have masked links

They can actually have masked links in them. on the bridge, if you send something like [hi](https://matrix.org) it'll show up properly on discord. Only users aren't able to send these, but the bridge/webhook is not a normal user. grafik

SethFalco commented 1 year ago

but the bridge/webhook

That only applies to webhooks though. When the bridge sends a message normally (i.e. responding to commands) those are normal Discord messages coming from the bot, not webhook payloads.