Done Scripted Button Permissions

Currently, without being a Global Bot, Bots cannot use scripted HTML buttons in private rooms or subroomgroupchats, which causes multiple issues for Bots that rely on buttons for games to work (such as Chess). For this, I had three possible suggestions:

a) Allow Bots to use them in private rooms, and in subroomgroupchats only if they have a */# in the parent room. This would only be applicable to SEND buttons, not RECEIVE buttons.
b) Allow any Bot with a public/hidden * to use SEND buttons in any room where they have permission to use HTML.
c) Add a third button type called WHISPER (or something else; I'm bad at naming things) that would send the originator of the HTML a non-command string (ie; may not be prefixed with a / or !) from the user. (Something like <button name="whisper" target="partbot" value=",chess play...">, where the server automatically sets the target to the user that sent it.
 
So, ran two dozen tests with the validator (separately). Here, Permitted refers to whether a user would normally be allowed to use scripted buttons.



1) As Permitted:
Input : <button name="whisper" value="Hi">STUFF</button>"<>"
Output: <button name="send" value="/pm PartBot, Hi">STUFF</button>"<>"
Pass: Passed.

2) As Permitted:
Input : <button style="stuff">STUFF</button>"<>"
Output: <button style="stuff">STUFF</button>"<>"
Pass: Passed.

3) As Permitted:
Input : <button name="send" style="stuff">STUFF</button>"<>"
Output: <button name="send" style="stuff">STUFF</button>"<>"
Pass: Passed.

4) As Permitted:
Input : <button>STUFF<button>"<>"
Output: <button>STUFF<button>"<>"
Pass: Passed.

5) As Permitted:
Input : <button name="whisper" value="TEST" style="STUFF">STUFF
Output: <button name="send" value="/pm PartBot, TEST" style="STUFF">STUFF
Pass: Passed.

6) As Permitted:
Input : <BUTTON onlick="console.log('Gottem.')">
Output: <BUTTON onlick="console.log('Gottem.')">
Pass: Passed.

7) As Permitted:
Input : <butTOn name="whisper" value=" /Test.">
Output: null
Pass: Nope - Can't use a command with whisper.

8) As Permitted:
Input : <BUTTON name="send" value="Hi!">
Output: <BUTTON name="send" value="Hi!">
Pass: Passed.

9) As Permitted:
Input : <button value="test">
Output: <button value="test">
Pass: Passed.

10) As Permitted:
Input : <button value="test" name="send">
Output: <button value="test" name="send">
Pass: Passed.

11) As Permitted:
Input : <button value="test" style="stuff" name="whisper">
Output: <button value="/pm PartBot, test" style="stuff" name="send">
Pass: Passed.

12) As Permitted:
Input : <button style="stuff" value="/logout" name="whisper">
Output: null
Pass: Nope - Can't use a command with whisper.

13) As non-Permitted:
Input : <button name="whisper" value="Hi">STUFF</button>"<>"
Output: <button name="send" value="/pm PartBot, Hi">STUFF</button>"<>"
Pass: Passed.

14) As non-Permitted:
Input : <button style="stuff">STUFF</button>"<>"
Output: <button style="stuff">STUFF</button>"<>"
Pass: Passed.

15) As non-Permitted:
Input : <button name="send" style="stuff">STUFF</button>"<>"
Output: null
Pass: Nope - Can't use scripted buttons.

16) As non-Permitted:
Input : <button>STUFF<button>"<>"
Output: <button>STUFF<button>"<>"
Pass: Passed.

17) As non-Permitted:
Input : <button name="whisper" value="TEST" style="STUFF">STUFF
Output: <button name="send" value="/pm PartBot, TEST" style="STUFF">STUFF
Pass: Passed.

18) As non-Permitted:
Input : <BUTTON onlick="console.log('Gottem.')">
Output: null
Pass: Nope - Can't use scripted buttons.

19) As non-Permitted:
Input : <butTOn name="whisper" value=" /Test.">
Output: null
Pass: Nope - Can't use a command with whisper.

20) As non-Permitted:
Input : <BUTTON name="send" value="Hi!">
Output: null
Pass: Nope - Can't use scripted buttons.

21) As non-Permitted:
Input : <button value="test">
Output: null
Pass: Nope - Can't use scripted buttons.

22) As non-Permitted:
Input : <button value="test" name="send">
Output: null
Pass: Nope - Can't use scripted buttons.

23) As non-Permitted:
Input : <button value="test" style="stuff" name="whisper">
Output: <button value="/pm PartBot, test" style="stuff" name="send">
Pass: Passed.

24) As non-Permitted:
Input : <button style="stuff" value="/logout" name="whisper">
Output: null
Pass: Nope - Can't use a command with whisper.




Are any of these behaviours undesired?

Note: Rather than adding an extra term in the button references in client, I ended up replacing the name and value parameters in the ouptut. If you'd rather handle that in the client, I can change it.


Oh, and this fails on open buttons, but those should be caught in the HTML tag validator.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top