-
My bot is being run from a pyqt launcher and whenever you push a button it would (in theory) start/stop the bot. Only issue is that once the but is disconnected it is no longer connecting. is there any workaround to this? Regardless of it being ideal I'm really trying to figure this out and I figured the best way is to ask in hopes of finding someone else who has achieved this through a method I'm not seeing. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
im in the exact situation as you. hopefully theres a solution. if you find any, please let me know! |
Beta Was this translation helpful? Give feedback.
-
Bot objects are designed to be connect-once affairs. You might have to recreate it. Also, it's a really not great idea to be reloading like this- discord affords you a limited number of connections/day, and it's pretty hefty to rebuild the cache. If you're just sending messages one-off you should look at webhooks, and if you aren't actively receiving websocket events (messages, presence events, reaction-adds, etc), you can just use the rest API without connecting a websocket, thus sidestepping this problem entirely. |
Beta Was this translation helpful? Give feedback.
Bot objects are designed to be connect-once affairs. You might have to recreate it.
Also, it's a really not great idea to be reloading like this- discord affords you a limited number of connections/day, and it's pretty hefty to rebuild the cache. If you're just sending messages one-off you should look at webhooks, and if you aren't actively receiving websocket events (messages, presence events, reaction-adds, etc), you can just use the rest API without connecting a websocket, thus sidestepping this problem entirely.