Conversation
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/3044/head:pr-3044
git checkout pr-3044This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3044/head |
|
am scared... |
|
|
|
Lol the commit is 3 weeks old I got it bang on 😆 . Still have to implement the csv stuff tho. |
|
Note Updating the target users list does not work yet and fails with |
discord/http.py
Outdated
|
|
||
| async def json_or_text(response: aiohttp.ClientResponse) -> dict[str, Any] | str: | ||
| text = await response.text(encoding="utf-8") | ||
| async def json_or_text( |
There was a problem hiding this comment.
This could maybe be renamed, give ideas
|
@Lumabots When you have some free time you can mess around around with this, see the example for details on the target users stuff, there's also the roles field for create_invite. |
I will not have free time until next Tuesday |
It's ok, this targets 2.8 anyways |
Co-authored-by: JustaSqu1d <89910983+JustaSqu1d@users.noreply.github.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
Signed-off-by: Paillat <paillat@pycord.dev>
|
|
||
| You must have created this invite or the :attr:`~Permissions.manage_guild` or :attr:`~Permissions.view_audit_log` | ||
| permission to do this. |
There was a problem hiding this comment.
If you made it to this object you already have permissions
| You must have created this invite or the :attr:`~Permissions.manage_guild` or :attr:`~Permissions.view_audit_log` | |
| permission to do this. |
There was a problem hiding this comment.
This object is weird, it is created like a discord.Asset. I still have to think if this is the best way of doing it but we discussed it on discord already with others (Soheab I think ?)
| async def edit(self, target_users_file: File) -> None: | ||
| """|coro| | ||
|
|
||
| Updates the target users list for this invite. | ||
|
|
||
| You must have created this invite or the :attr:`~Permissions.manage_guild` permission to do this. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| target_users_file: :class:`File` | ||
| A CSV file with a single column of user IDs for all the users able to accept this invite. | ||
|
|
||
| Raises | ||
| ------ | ||
| HTTPException | ||
| Updating the target users failed. | ||
| Forbidden | ||
| You do not have permissions to edit this invite. | ||
| NotFound | ||
| The invite is invalid or expired. | ||
| """ | ||
| await self._state.http.update_invite_target_users( | ||
| self.invite_code, target_users_file=target_users_file | ||
| ) | ||
|
|
||
| async def get_job_status(self) -> InviteTargetUsersJobStatus: | ||
| """|coro| | ||
|
|
||
| Retrieves the status of the target users processing job for this invite. | ||
|
|
||
| You must have created this invite or the :attr:`~Permissions.manage_guild` or :attr:`~Permissions.view_audit_log` | ||
| permission to do this. | ||
|
|
||
| Returns | ||
| ------- | ||
| :class:`InviteTargetUsersJobStatus` | ||
| The job status information. | ||
|
|
||
| Raises | ||
| ------ | ||
| HTTPException | ||
| Fetching the job status failed. | ||
| NotFound | ||
| The invite is invalid or expired. | ||
| Forbidden | ||
| You do not have permission to view the target users. | ||
| """ | ||
| r = await self._state.http.get_invite_target_users_job_status(self.invite_code) | ||
| return InviteTargetUsersJobStatus(data=r) |
There was a problem hiding this comment.
I think this makes more sense on Invite
Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
Summary
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.