@Tonnoaw I would also try to import game_menu.py and build a menu with title and option selection buttons. So, rather than setting “cheat” mode in the script, define a mode button for a non-programmer to change mode of operation.
You want to use the global keyword inside your functions in order to allow your variable to be modified outside the defining scope.
Actually you think you want globals,but usually they lead to grief, since it can be hard to debug -- for instance when you forget to declare global inside a function, you can read variables defined in external scope but not modify it. So it is easy to get confused.
Consider using a class, then you can store things like that as class instance variables. Then it is never ambiguous which copy of the variable you are modifying.
This, or when you're on a connection that is a bit too slow or unreliable for streaming. In that case it's nicer to download a video in the background for a while, so you can watch it uninterrupted afterwards, without having to wait for it to buffer every few minutes.
You cannot put a blocking function inside a button action, or other methods that are called on the ui thread. The calls to the form need to be called as @ui.in_background if that is the case.
There may be an issue which I have noticed recently when dealing with for examples the photos picker, that presenting a view while another is closing might lead to issues. yOu might try adding a time.sleep() after wait_modal, since this implies you have another view which is getting closed right before this chunk executes.
It might be helpful to see the entire method, or a complete standalone example that shows the issue.
@ccc , no I was not in any of the beta programs. I found the update worked from the updates page, although from the app's own page when an update is available the button changes from "open" to "update". I was not seeing that from the app's page itself. My only option was "open" and when I opened and went to the settings dialog in Pythonista 3 it clearly said 3.0 and not 3.1 (which it did display after updating from the updates page). Now I have the widget!
I'm afraid you probably won't get many helpful responses here, because discord.py has nothing to do with Pythonista, and because Pythonista isn't the best platform to run a Discord bot on. You'll probably get more help if you ask on a site like Stack Overflow, or on a discussion site for discord.py. Maybe there is a Discord server for discord.py. :)