Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash Command Channel Parsing Bug Fixes #1257

Merged
merged 5 commits into from Apr 14, 2022
Merged

Slash Command Channel Parsing Bug Fixes #1257

merged 5 commits into from Apr 14, 2022

Conversation

plun1331
Copy link
Member

@plun1331 plun1331 commented Apr 13, 2022

Summary

  • Fixes parsing of channels in slash command invocations:
Traceback (most recent call last):
  File "C:\Users\cplun\Documents\GitHub\SkyKings Public Bot\venv\lib\site-packages\discord\commands\core.py", line 122, in wrapped
    ret = await coro(arg)
  File "C:\Users\cplun\Documents\GitHub\SkyKings Public Bot\venv\lib\site-packages\discord\commands\core.py", line 811, in _invoke
    arg = obj_type(state=ctx.interaction._state, data=_data, **kw)
TypeError: 'tuple' object is not callable
  • Makes the position attribute optional because Discord wasn't sending it:
Traceback (most recent call last):
  File "C:\Users\cplun\Documents\GitHub\SkyKings Public Bot\venv\lib\site-packages\discord\commands\core.py", line 122, in wrapped
    ret = await coro(arg)
  File "C:\Users\cplun\Documents\GitHub\SkyKings Public Bot\venv\lib\site-packages\discord\commands\core.py", line 810, in _invoke
    arg = obj_type(state=ctx.interaction._state, data=_data, **kw)
  File "C:\Users\cplun\Documents\GitHub\SkyKings Public Bot\venv\lib\site-packages\discord\channel.py", line 176, in __init__
    self._update(guild, data)
  File "C:\Users\cplun\Documents\GitHub\SkyKings Public Bot\venv\lib\site-packages\discord\channel.py", line 195, in _update
    self.position: int = data["position"]
KeyError: 'position'

There was apparently a PR for this (#1246) but it was closed

Fixes #1241

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, typehinting, examples, ...)

@plun1331 plun1331 changed the title Slash Command Option Bug Fixes Slash Command Channel Parsing Bug Fixes Apr 13, 2022
@jab416171
Copy link
Contributor

does this fix #1241 and #1244?

@plun1331
Copy link
Member Author

does this fix #1241 and #1244?

It fixes what I said it fixes
Screenshot_20220412-182000.png

@jab416171
Copy link
Contributor

I'm just asking because you called out #1246 which fixes #1244.

@plun1331
Copy link
Member Author

I'm just asking because you called out #1246 which fixes #1244.

I don't think that PR fixed that ngl

@krittick krittick self-requested a review April 14, 2022 00:49
@krittick krittick added priority: high High Priority status: awaiting review Awaiting review from a maintainer Merge with squash labels Apr 14, 2022
@krittick krittick added this to In progress in v2.0 via automation Apr 14, 2022
@krittick krittick added this to the v2.0 milestone Apr 14, 2022
@krittick krittick enabled auto-merge (squash) April 14, 2022 00:49
@krittick
Copy link
Contributor

LGTM

@krittick krittick merged commit 9fdfd56 into Pycord-Development:master Apr 14, 2022
v2.0 automation moved this from In progress to Done Apr 14, 2022
@krishsharma0413
Copy link

issue still isnt resolved, the error still exists for slash command option of textchannel

@argo0n
Copy link
Contributor

argo0n commented Apr 14, 2022

issue still isnt resolved, the error still exists for slash command option of textchannel

Reinstalled Pycord through Github and it worked for me though

@krishsharma0413
Copy link

issue still isnt resolved, the error still exists for slash command option of textchannel

Reinstalled Pycord through Github and it worked for me though

weird cause it didnt for me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high High Priority status: awaiting review Awaiting review from a maintainer
Projects
No open projects
v2.0
  
Done
Development

Successfully merging this pull request may close these issues.

TypeError: 'tuple' object is not callable when a channel is provided as a slash command option. (2.0.0b7)
7 participants