You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
thank you for this work! It looks exactly like what i need.
Unfortunately I running into an issue trying to run it. It happens after the bot connected to the database.
~/VoteBot % python3 votebot.py
PG Ran ./db/build.sql
Traceback (most recent call last):
File "votebot.py", line 10, in <module>
from voting import voteDB
File "/home/discord/VoteBot/voting/voteDB.py", line 21, in <module>
def addVote(creator: discord.User, question: str, options: list[str], limit: int, guild: discord.Guild, channel: discord.TextChannel,
stage: int = 0, type: int = 1, num_win: int = 1, title_pre: str = "Poll") -> tuple[int, str]:
TypeError: 'type' object is not subscriptable
I am running Python 3.8.10. Is there any specific versino required? Or maybe special setting or something that i need to consider?
Thank you!
The text was updated successfully, but these errors were encountered:
In Python 3.8, to specify a list element type you needed to (import and) use typing.List, but in 3.9 this functionality was merged into the basic list.
There are 3 solutions:
upgrade to Python 3.9
replace any instance of list, dict, tuple, etc. in type signatures with List, Dict, Tuple (needs to be imported from typing)
Remove the brackets and contents from these types, or the types entirely. They are only useful for development.
Awesome, thank you!
I've upgraded to 3.9 and the bot starts now. Maybe you could add that to the readme? Maybe together with the information that + is the default prefix and not ! as one could think based on your screenshot.
Hi,
thank you for this work! It looks exactly like what i need.
Unfortunately I running into an issue trying to run it. It happens after the bot connected to the database.
I am running Python 3.8.10. Is there any specific versino required? Or maybe special setting or something that i need to consider?
Thank you!
The text was updated successfully, but these errors were encountered: