Closed LeoAlt8 closed 1 year ago
needsVIP
expects a boolean value and those have a capital first letter in Python: True
, not true
. If you use the latter, Python expects it to be a variable and tries to evaluate it, which will fail, because you have not defined true
. Depending on your IDE (hopefully, you don’t write Python code in a simple text editor), you should see a difference between true
and True
in the syntax highlighting of the IDE.
Thank you. The description in README.md was just misleading. Please correct the README.md when you have time. ❤️
P.S. You once wrote that you would add support for access to the command by nickname. Is it still topical?
Thanks for pointing this out. The typo in the manual has been fixed now.
Additionally, I have implemented the key checks for senderName
and senderDisplayName
. Those two keys can now be used in the command definitions to limit the usage of command to the specified user(s). This key is a list of users, i. e. even if you want to specify only one user it has to be a list.
commands = {
'^!hug' : {
'answer' : '$senderDisplayName gives $arg0s and $arg1s cat a hug.',
'matchType' : 'regex',
'cooldown' : 10,
'senderName' : ['catlover', 'kittygirl', 'meowmeow']
},
Last but not least I have changed the cyrillicToLatin()
routine in such a way that it will only apply when the message contains a mixture of Cyrillic letters and Latin ones so that messages consisting solely of Cyrillic letters will not be affected.
Did not work out. I tried both the senderName
and the senderDisplayName
in the senderName
. Nickname copied from the sender's address bar. Nickname without caps. The bot just doesn't respond.
Fix has been uploaded. I had two evaluations of the senderName
and senderDisplayName
in the routine – one for the new name list, one for a string. Looked like I had already implemented that some time ago for strings, forgot about it, implemented it again for lists yesterday, and as both are incompatible with each other, it simply had to fail in any case. m/ Sorry about that.
I just tried the update today. Was busy. I want to say it's great! This is a unique feature! I have not met the answer before only by nickname! Thanks!!! ❤️👍
Again does not work. The bot answers everyone. VIP and not VIP. 😭
@weidengeist , written like this.
"!xxx" : {
"answer" : "xxxxxxxxx",
'matchType' : 'startsWith',
"cooldown" : 10,
"needsVIP" : True
},
I have just uploaded a potential fix. Please test if it works now.
Yes. Works. Thank you! 👍❤️
Error occurs after adding command:
"!!аз" : { "answer" : "Това действие е достъпно само за вас. Така че получавате милион сърца bleedPurple bleedPurple bleedPurple ", "cooldown" : 30, "needsVIP" : true