Open MasterCruelty opened 2 years ago
Edit: This problem is probably linked with using global variables
Can i help you in that @MasterCruelty ?
Can i help you in that @MasterCruelty ?
Of course you can! Here you find a few guidelines to contribute to the project. (The first step is done because there's already an issue) These are the files affected: weather.py, lyrics.py, urban.py
Do you have any idea to do this?
Currently I don't have any idea for now. But I will run code in my system first after checking function I get the idea 👍
Currently I don't have any idea for now. But I will run code in my system first after checking function I get the idea 👍
Got it! Let me know after your check 👌
@archetipico do you have any idea to solve?
I'll look at it as soon as I have free time
The next issue I'll try to fix is this One as soon as I have an hour or two to spend on it.
@archetipico Any ideas?
The last time I wrote here was March 31... I forgot about this issue.
May I suggest that instead of using global k
you just pass the variable to the function, like this
def press_button(client, message, k)
... # your code without global k
I think the global
keyword is initializing k
everytime (I may be wrong, but trying isn't harmful)
The last time I wrote here was March 31... I forgot about this issue.
May I suggest that instead of using
global k
you just pass the variable to the function, like thisdef press_button(client, message, k) ... # your code without global k
I think the
global
keyword is initializingk
everytime (I may be wrong, but trying isn't harmful)
If I'm not wrong(it's a bit since my last reiew of that code), that's the problem. If you use global variables it "works" with this issue, but if you use local variables, you can't increment it when you press the button because the new istance has no memory of that variable(it's in the older process, not the current)
Typing
/urban argument1
and then/urban argument2
will be resulting in a conflict because if you press the button of the first command you get the next page ofargument1
but if you press the button of the second command, you get still the next page ofargument1
instead ofargument2
.I used
/urban
as an example but the problem is intended in every function that uses Inline buttons.urban.py