MehulKhanna / PokeGrinder

An Auto-Grinding Bot for PokéMeow with Slash Commands! With a free Captcha Solver!
MIT License
10 stars 6 forks source link

Possible error in startup.py #41

Closed AloW0304 closed 8 months ago

AloW0304 commented 8 months ago

After downloading the new update, I think I might've found an error, the document startup.py comes up with this error: Tuple expression not allowed in type annotation   Use Tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type   which is talking about this command here:   async def get_commands(bot: commands.Bot, channel_id: int) -> ( TextChannel, dict[str, SlashCommand | UserCommand | MessageCommand | SubCommand] | None, ):

with this line of code here: ( TextChannel, dict[str, SlashCommand | UserCommand | MessageCommand | SubCommand] | None, ): being broadcast as the problem

AloW0304 commented 8 months ago

Also thanks so much for the consistent and constant support you are giving to this project, it is greatly appreciated. :)

AloW0304 commented 8 months ago

The impact of this error causes this error message when running main.py File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/client.py", line 600, in _run_event await coro(*args, **kwargs) File "/Users/Desktop/PokeGrinder-2.4/cogs/startup.py", line 51, in on_ready await get_commands(self.bot, self.config.hunting_channel_id) File "/Users/Desktop/PokeGrinder-2.4/cogs/startup.py", line 31, in get_commands for command in await channel.application_commands() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'TextChannel' object has no attribute 'application_commands'

Then the Pokegrinder logs and table pop up but nothing happens, eta time increases but no encounters or catches happen

MehulKhanna commented 8 months ago

After downloading the new update, I think I might've found an error, the document startup.py comes up with this error: Tuple expression not allowed in type annotation   Use Tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type   which is talking about this command here:   async def get_commands(bot: commands.Bot, channel_id: int) -> ( TextChannel, dict[str, SlashCommand | UserCommand | MessageCommand | SubCommand] | None, ):

with this line of code here: ( TextChannel, dict[str, SlashCommand | UserCommand | MessageCommand | SubCommand] | None, ): being broadcast as the problem

Remove this part of the code that is causing the error :- -> ( TextChannel, dict[str, SlashCommand | UserCommand | MessageCommand | SubCommand] | None, ) And then try running again

AloW0304 commented 8 months ago

image After running, this comes up in the terminal. Nothing is spawned or caught, only the time keeps ticking. There is no more error message now.

MehulKhanna commented 8 months ago

image After running, this comes up in the terminal. Nothing is spawned or caught, only the time keeps ticking. There is no more error message now.

Remove this line from modules/logging.py then look for errors os.system("cls" if os.name == "nt" else "clear")

MehulKhanna commented 8 months ago

image After running, this comes up in the terminal. Nothing is spawned or caught, only the time keeps ticking. There is no more error message now.

I have updated the repository this must be fixed now.

AloW0304 commented 8 months ago

getting this error now: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/client.py", line 600, in _run_event await coro(*args, **kwargs) File "/Users/Desktop/PokeGrinder-2.4/cogs/startup.py", line 48, in on_ready await get_commands(self.bot, self.config.hunting_channel_id) File "/Users/Desktop/PokeGrinder-2.4/cogs/startup.py", line 28, in get_commands for command in await channel.application_commands() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'TextChannel' object has no attribute 'application_commands'

which is the same error as before, however now my table looks like this: image

MehulKhanna commented 8 months ago

getting this error now: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/client.py", line 600, in _run_event await coro(*args, **kwargs) File "/Users/Desktop/PokeGrinder-2.4/cogs/startup.py", line 48, in on_ready await get_commands(self.bot, self.config.hunting_channel_id) File "/Users/Desktop/PokeGrinder-2.4/cogs/startup.py", line 28, in get_commands for command in await channel.application_commands() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'TextChannel' object has no attribute 'application_commands'

which is the same error as before, however now my table looks like this: image

Install git here Then run these commands and then try again:-

pip uninstall discord.py-self
git clone https://github.com/dolfies/discord.py-self
cd discord.py-self
python3 -m pip install -U .[voice]
AloW0304 commented 8 months ago

each command works except the final command: python3 -m pip install -U .[voice] I get the error: zsh: no matches found: .[voice] Should I use a different shell that's not zsh?

AloW0304 commented 8 months ago

Nevermind, fixed it. Once again, thank-you so much, it is greatly appreciated

Nozmic commented 7 months ago

Hello I am facing the same issue image

MehulKhanna commented 7 months ago

Hello I am facing the same issue image

Please check your channel ids in the config. Make sure you can access the channel that you put in the config.

Nozmic commented 7 months ago

image Now I am getting this error.

Is this how ur supposed to put the channel ID in config? { "ClearConsole": false, "CaptchaSolver": true, "LoggingInterval": 10, "SuspicionAvoidance": 250, "abcdtoken": { "1088783924xxxxxxxx": 1, "10889183148xxxxxxxx": 0, "Balls": { "Common": "pb", "Uncommon": "pb", "Rare": "gb", "Super Rare": "ub", "Legendary": "mb", "Shiny": "mb", "Shiny Event": "mb", "Shiny Full-odds": "prb" },

MehulKhanna commented 7 months ago

image Now I am getting this error.

Is this how ur supposed to put the channel ID in config? { "ClearConsole": false, "CaptchaSolver": true, "LoggingInterval": 10, "SuspicionAvoidance": 250, "abcdtoken": { "1088783924xxxxxxxx": 1, "10889183148xxxxxxxx": 0, "Balls": { "Common": "pb", "Uncommon": "pb", "Rare": "gb", "Super Rare": "ub", "Legendary": "mb", "Shiny": "mb", "Shiny Event": "mb", "Shiny Full-odds": "prb" },

no lol. this is how you put it:-

"HuntingChannel": 1088783924xxxxxxxx,
"FishingChannel": 10889183148xxxxxxxx,
Nozmic commented 7 months ago

Oh now it works thanks. But whenever it says "Please wait a few more seconds to find another Pokemon!" the bot stops working and I have to do /pokemon for it to start catching again