ArtemGr / Sidekick

Dice and LFG bot for Discord.
MIT License
249 stars 39 forks source link

Private rolls #35

Open ArtemGr opened 7 years ago

ArtemGr commented 7 years ago

There's an idea from one of our Patreon backers. To quote: "private rolls directly to the storyteller so only they and a single player can see it"

omnilord commented 7 years ago

I like this. Something like /r @userid {dicestring}

ArtemGr commented 7 years ago

Hey, @omnilord ! What's the userid be like? Is it the thing that "Copy ID" context menu gives you, something like "125366246245007360"?

omnilord commented 7 years ago

In Discord you can use @username as a mention.

ArtemGr commented 4 years ago

cf. #205

We're one step closer to this as I've test the ability for Sidekick to send private messages to people (we can send a message if the user shares a server with the bot).

It's easier to use the integer user ID for that. @username would require us to maintain a list of users in RAM.

omnilord commented 4 years ago

It's easier to use the integer user ID for that. @username would require us to maintain a list of users in RAM.

I'm not sure I follow what the issue is. When you get a message from Discord, a user mention that end users see as @username is encoded with the user id implicitly in the format <@userid>. You should be able to use a regex /<@!?(?<id>\d+)>/ to grab it on the fly.

Also, depending on the discord library you are using, it probably already provides this utility for you.

ArtemGr commented 4 years ago

When you get a message from Discord, a user mention that end users see as @username is encoded with the user id implicitly in the format <@userid>

Neat!