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

Unexpected behavior with bot.fetch_webhook #866

Closed
3 tasks done
eltaylor1104 opened this issue Jan 27, 2022 · 4 comments
Closed
3 tasks done

Unexpected behavior with bot.fetch_webhook #866

eltaylor1104 opened this issue Jan 27, 2022 · 4 comments

Comments

@eltaylor1104
Copy link

eltaylor1104 commented Jan 27, 2022

Summary

Using bot.fetch_webhook, I receive an error that '_MissingSentinel' object has no attribute 'request'

Reproduction Steps

  1. Latest version of Pycord installed via the GitHub (alpha version)
  2. Plug in a valid webhook id to bot.fetch_webhook
  3. Receive the error

Minimal Reproducible Code

url = await bot.fetch_webhook(webhookid)
await url.send(embed=embed)

Expected Results

Send an embed to the specified webhook

Actual Results

Received this error:

  File "/home/ec2-user/Loggy/cogs/logevents.py", line 151, in on_message_edit
    url = await bot.fetch_webhook(webhookid)
  File "/home/ec2-user/.local/lib/python3.8/site-packages/discord/client.py", line 1555, in fetch_webhook
    data = await self.http.get_webhook(webhook_id)
  File "/home/ec2-user/.local/lib/python3.8/site-packages/discord/http.py", line 276, in request
    async with self.__session.request(method, url, **kwargs) as response:
AttributeError: '_MissingSentinel' object has no attribute 'request'

(webhook id is substituted out so as to not give everyone access to a webhook)

Intents

discord.Intents.all()

System Information

  • Python v3.8.5-final
  • py-cord v2.0.0-candidate
    • py-cord pkg_resources: v2.0.0rc1
  • aiohttp v3.8.1
  • system info: Linux 5.10.82-83.359.amzn2.x86_64 Update README.rst #1 SMP Tue Nov 30 20:47:14 UTC 2021

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

@eltaylor1104 eltaylor1104 added the unconfirmed bug A bug report that needs triaging label Jan 27, 2022
@zeffo zeffo added bug Something isn't working and removed unconfirmed bug A bug report that needs triaging bug Something isn't working labels Jan 27, 2022
@zeffo
Copy link
Contributor

zeffo commented Jan 27, 2022

I thought this was a bug, but it's raised when the method is called before the bot has logged in.

@eltaylor1104
Copy link
Author

Really? My bot is long since logged in 🤔

@zeffo
Copy link
Contributor

zeffo commented Jan 28, 2022

Could you ping me on discord (Zeffo#0393) with your whole code please?

@zeffo
Copy link
Contributor

zeffo commented Jan 28, 2022

This has been resolved on discord. Closing.

@zeffo zeffo closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants