The function is_open() in monitor.py should be tested. This will require downloading Discord and actually testing it out.
Steps to do this:
Download Discord for your desktop (this does not work with the web app), make an account, run it, join a server (any server—joining a server simply requires clicking a link, like this one).
To test is_open(), replace the last line with print(is_open()). Now run this program on Command Prompt by entering its directory and typing python monitor.py.
You should get something like "Discord, #channelname - Discord". It should be a concatenation of Discord, a comma, and then some sort of descriptor of the channel name. If you don't, which I have reasonable suspicion you won't, what you need to do will depend on what part you're lacking. If you're lacking the former (i.e. it looks like "#channelname - Discord"), you need to find out how to get the name of an application (like, the name of the actual application which is running) on Windows from the psutil.Process object created in line 54. If you're lacking the latter (i.e., just "Discord"), you need to find how to get the actual name of the window itself, not the application. Then, concatenate these two accordingly.
For anyone who tries to do this: even if you don't succeed, I really want to know what happens on Windows. So even just commenting below with what result you get helps.
The function
is_open()
in monitor.py should be tested. This will require downloading Discord and actually testing it out.Steps to do this:
is_open()
, replace the last line withprint(is_open())
. Now run this program on Command Prompt by entering its directory and typingpython monitor.py
.psutil.Process
object created in line 54. If you're lacking the latter (i.e., just "Discord"), you need to find how to get the actual name of the window itself, not the application. Then, concatenate these two accordingly.For anyone who tries to do this: even if you don't succeed, I really want to know what happens on Windows. So even just commenting below with what result you get helps.
Thanks guys!