stadas / ankicord Goto Github PK
View Code? Open in Web Editor NEWA Discord Rich Presence add-on for Anki
A Discord Rich Presence add-on for Anki
Right now the requests are sent only when a hook is triggered, i.e. when user goes to main menu or reviews a card, etc.
This is not ideal because if, for example, the user is still on the 15sec cooldown and they switch from reviewing to menu, it will not update the Rich Presence.
This can be fixed using python's Thread library by making the requests constantly send every 15 seconds and simply grabbing the currently active status from a variable instead of relying on a hook to activate. The hooks will still be used to update the status inside the code, though.
General info (please complete the following information):
Describe the bug
Add-on does not work on Windows, without any errors (maybe some output if launched from the console?) if Anki is not launched as administrator.
I'd like to show which deck I'm working on. I think people should have the option to enable or disable this option since not everyone wants to show the names of their decks.
General info (please complete the following information):
Describe the bug
The addon throws the Error below whenever Anki is started when Discord is not running. For me, this is every time, Anki starts at system start and it starts faster than Discord does.
An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.
When loading 'Ankicord - Discord Rich Presence':
Traceback (most recent call last):
File "aqt\addons.py", line 230, in loadAddons
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813_init_.py", line 2, in
from .src import main
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 250, in
ac = Ankicord()
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 33, in init
self.rpc = pp.Presence(self.cfg_disc_id if self.cfg_disc_id else self.default_disc_id)
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\pypresence\presence.py", line 13, in init
super().init(*args, **kwargs)
File "C:\Users\Chris\AppData\Roaming\Anki2\addons21\1828536813\src\pypresence\baseclient.py", line 28, in init
raise DiscordNotFound
1828536813.src.pypresence.exceptions.DiscordNotFound: Could not find Discord installed and running on this machine
I have my config set such that no activity is shown when I'm on the main screen. Opening the browser shows the "browsing cards" status on discord. However, closing the browser and returning to the main screen does not remove this activity. Same thing happens if I try to add cards from the main screen and then exit out of the add cards dialog
Config:
{
"defaults": {
"main": {
"activity": "on",
"card_count": "on",
"count_deck": "on",
"counts": [
"new",
"learn",
"review"
],
"deck_name": "off",
"discord_client": "745326655395856514",
"spotify": "off",
"timer": "on"
},
"statuses": {
"browsing_status": "Browsing Cards",
"editing_status": "Adding cards",
"menu_status": "",
"no_cards_left_txt": "No cards left!",
"reviewing_status": "Daily reviews"
}
}
}
Hi, I love the addon and just wanted to post a bug that I am having.
I have my main anki deck that i keep up with daily, and then a secondary 'burner' anki deck that I kinda/sorta/should really do.
I have count_deck set to 'yes', however it seems to still sum up all of my unsuspended cards, rather than just my last deck, as you can see in the screenshots below. It should be only registering the latest deck, the Anking Overhaul deck.
Am I doing something wrong, or is there some sort of bug that I am happy to help troubleshoot
Hey, Idk if this is of interest to anyone but I would really like if this add-on worked with versions below 2.149. I use 2.135 & I cannot use it and can't find another that has the same functionality. Thanks for the help!
count_deck isn't working. I have count_deck and card_count set to on. While reviewing a deck with only 140 cards left, Discord shows I have 1200 cards left. The 1200 number goes down by 1 as I do cards in the 140 card deck.
i didn't understand how to make a pull request 😆
Thanks for the config addon, makes the integration more fun and the icon is awesome
gl to your uni
In the future
you could try creating the option to change the icon using the same idea as the background addon -that use a photo folder to change the background
ty for the addon
General info (please complete the following information):
Describe the bug
I'm sorry I can't say much but I'm just not seeing anything happen when the addon is installed. Please let me know what information I can provide if it used to work on Linux.
I downloaded the add-on, but for some reason, it is still not working. Do I have to enable something specific on Discord?
Hi! thank you for making this add on.
I installed it using the anki code, but unfortunately nothing is displayed in my discord activity section. I tried playing around in the configs but to no avail. The same issue happened to me with the AnkiDiscord add on, so i was wondering if you're familiar with this situation.
General info (please complete the following information):
Describe the bug
A clear and concise description of what the bug is.
General info:
Describe the bug
Basically, it works completely fine with the desktop Discord app, but I generally use the web ver. which just completely doesn't work.
Taken from a review on the ankiweb addon page
ERROR:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-08-10 22:18:06
Caught exception:
Traceback (most recent call last):
File "aqt\reviewer.py", line 837, in onBuryCard
File "aqt\main.py", line 691, in reset
File "aqt\main.py", line 656, in moveToState
File "aqt\hooks_gen.py", line 2679, in call
File "anki\hooks.py", line 34, in runHook
File "C:\Users\ASUS\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 200, in on_state
self.last_deck = mw.col.decks.get(mw.reviewer.card.did)
AttributeError: 'NoneType' object has no attribute 'did'
General info (please complete the following information):
Describe the bug
When clicking on the top buttons (Decks, Add, Browse, Stats, Sync), this error pops up.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-04-10 21:28:39
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000022411123C10>
Traceback (most recent call last):
File "asyncio\proactor_events.py", line 115, in del
File "asyncio\proactor_events.py", line 79, in repr
File "asyncio\windows_utils.py", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
General info (please complete the following information):
Describe the bug
Whenever the Profiles window opens Anki instantly crashes. This occurs when clicking the Switch Profile button and when launching Anki. It only crashes on launch if the user has multiple profiles saved as this causes the Profile window to open on start-up.
Debug info:
Anki 2.1.50 (26d40c3a) Python 3.9.7 Qt 6.2.2 PyQt 6.2.2
Platform: Windows 10
Flags: frz=True ao=True sv=?
Add-ons, last update check: 2022-04-14 08:39:42
Caught exception:
Traceback (most recent call last):
File "aqt.progress", line 115, in handler
File "aqt.main", line 186, in on_window_init
File "aqt.main", line 232, in setupProfileAfterWebviewsLoaded
File "aqt.main", line 277, in setupProfile
File "aqt.main", line 283, in showProfileManager
File "aqt.main", line 672, in moveToState
File "aqt.hooks_gen", line 3594, in call
File "anki.hooks", line 34, in runHook
File "C:\Users\Joshua\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 193, in on_state
self.__update_rpc_next_state()
File "C:\Users\Joshua\AppData\Roaming\Anki2\addons21\1828536813\src\main.py", line 157, in __update_rpc_next_state
node = mw.col.sched.deck_due_tree()
AttributeError: 'NoneType' object has no attribute 'sched'
General info (please complete the following information):
Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Windows-10-10.0.22631
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 116, in del
File "asyncio.proactor_events", line 108, in close
File "asyncio.base_events", line 751, in call_soon
File "asyncio.base_events", line 515, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x0000020B47322700>
Traceback (most recent call last):
File "asyncio.proactor_events", line 115, in del
File "asyncio.proactor_events", line 79, in repr
File "asyncio.windows_utils", line 102, in fileno
ValueError: I/O operation on closed pipe
Exception ignored in sys.unraisablehook:
AttributeError: 'ErrorHandler' object has no attribute 'flush'
===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Ankicord - Discord Rich Presence ['1828536813', 2023-08-16T10:53, 'None', '']
===IDs of active AnkiWeb add-ons===
1828536813
===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
]
Discord wont update the cards left or the status. It just says I'm slacking off and wont change the number of cards i have left even if I'm in a deck and doing cards. If I open browse cards while in a deck I get this error to pop up and it updates my status to browsing cards. but then when I close it, it goes back to slacking off.
Hi, thanks for making this, I was using the AnkiDiscord addon for some time now, but I'm switching over to this one because it seems to be better in almost every way.
Is there a reason why the status is limited to update only every 15 seconds? Would it be possible to make a config option to allow more frequent status updates? I manually changed it in main.py to update every 5 sec for now but I assume those changes will be overwritten next time this addon gets updated. Thanks.
It doesn't work.
I added the discord client id and it's showed up in Discord very well. But after that, it didn't show up anything.
https://i.imgur.com/AmTdth3.jpg
General info (please complete the following information):
Describe the bug
After the latest update, every time I check for updates in Anki, this add-on pops up as having an available update (latest 8/15/2023 update). Installing the updates does nothing it appears, and I am prompted to install the update again once I check for updates. On latest public Anki 65, MacOS.
Thanks for taking this on.
I generally have a problem with both addons including the old.
Both count the total cards in each deck.
but some of my decks I have are inactive and not on my study list.
It would be much much better if it just took the values that are in the current active deck that is being studied until it says "Congratulation, this deck is finished for today".
as for the current implementation I cannot use the card_count setting because it shows a value of almost 8000 cards left which is rather misleading.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.