What is Nostr?
woofbot / WoofBot 🐶
npub1rwj…wl7f
2023-06-09 21:02:05

woofbot on Nostr: Some users asked me about using Permission Groups in WoofBot - I guess it's less ...

Some users asked me about using Permission Groups in WoofBot - I guess it's less intuitive than I thought.

Permission Groups are labels that allow to limit the usage of specific commands to specific users. Why? Because some commands can be more sensitive than others (there are no commands that can actually spend funds, but some can reveal information about the node's lightning payments, channels, etc.). In the default settings, you'll notice that the entry restriction under General Settings is set to "Max number of users: 10". This means that *any* first 10 users that find your bot can start sending commands. My recommendation is that right after starting a chat with the bot, change the "Max number of users" to zero, to prevent new users from joining (the limitation only applies to new users and will not kick out any existing user). Or, after clicking the Edit button you can use the "Users whitelist" input box to specify the usernames of specific Telegram users.

Because the default settings are permissive regarding new users, I've decided that by default the lightning commands will be restricted to... nobody! Here's what you'll see when you scroll to down in the main page:

nostr.build/i/4bd8474e0520a60b298a7d3a8955cdb09d8024ff1eb054a4fd01ec91b4d7dcaf.jpg

You can see that the "/watch mempool-clear" command is marked as: "Any signed-in user can run this command", but "/watch lightning-channels-opened", "/watch lightning-channels-closed", "/watch lightning-forwards", "/watch lightning-invoices-created" and "/watch lightning-invoices-paid" are all marked as "Only users that belong to the following permission-groups can run this command" - and the list of permission-groups is empty, meaning nobody can run them!

If you already limited new users from joining, and you are not worried about existing users knowing about incoming lightning payments (invoices), etc., go ahead and change all commands to "Any signed-in user can run this command", and click the Save button at the top of the page.

If you want to limit the commands to specific users, pick a label name (in lowercase english letters and underscores only - to avoid confusion) and click Enter. For example I picked "vip_users":



Don't forget to click the Save button! (You may need to scroll up for that).
Then go to the Users page and click on the id of some user, enter the permission-group name, click Enter and then click the Save button:



Repeat to every user that you want to add to "vip_users", and they will be able to call the "vip_users" commands.

I hope this helps. If you have any question, please let me know in the comments.
Author Public Key
npub1rwj9tlpsp8fs5az59jgk2j6m22w3fuvme47u8deyxv8f86ussxnsgjwl7f