Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

✨ Add more guild methods #275

Merged
merged 45 commits into from
Dec 11, 2021
Merged

Conversation

Enderchief
Copy link
Member

Changes

Check off the following

  • I have tested my changes with the current requirements
  • My Code follows the pep8 code style.

@Enderchief Enderchief changed the title Issue 222 part a ✨ Add more guild methods Nov 30, 2021
@codecov
Copy link

codecov bot commented Nov 30, 2021

Codecov Report

Merging #275 (35b45ce) into main (a494db4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #275   +/-   ##
=======================================
  Coverage   90.00%   90.00%           
=======================================
  Files           9        9           
  Lines         100      100           
=======================================
  Hits           90       90           
  Misses         10       10           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a494db4...35b45ce. Read the comment docs.

@Enderchief Enderchief linked an issue Nov 30, 2021 that may be closed by this pull request
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
Copy link
Contributor

@VincentRPS VincentRPS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
Co-authored-by: RPS <vincentbusiness55@gmail.com>
Copy link
Member

@Lunarmagpie Lunarmagpie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realized the "X-Audit-Log-Reason" header was missing on some of these, you can check the create_role method in the guild class for an example.
Also made some suggested formatting changes. Feel free to deny them since I think its pep8 both ways.

pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
Enderchief and others added 2 commits November 30, 2021 13:35
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Enderchief and others added 4 commits December 6, 2021 14:45
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>
@Enderchief
Copy link
Member Author

Final fix

pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
Enderchief and others added 2 commits December 7, 2021 12:31
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Copy link
Member

@trag1c trag1c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if you could look over the following lines (even if they're not yours) and correct if possible :]

Don't feel obligated to tho
 149 [ 91]         Members will receive notifications only for messages that @mention them by default.
 355 [ 89]     default_message_notifications: APINullable[DefaultMessageNotificationLevel] = MISSING
1158 [ 89]             User ID to transfer guild ownership to (must be owner) |default| :data:`None`
1181 [ 90]             discovery and notices from Discord; defaults to "en-US" |default| :data:`None`
1185 [ 94]             The description for the guild, if the guild is discoverable |default| :data:`None`
1293 [ 95]             yield VoiceRegion.from_dict(construct_client_dict(self._client, voice_region_data))
1307 [ 84]             yield Invite.from_dict(construct_client_dict(self._client, invite_data))
1321 [ 94]             yield Integration.from_dict(construct_client_dict(self._client, integration_data))
1410 [118]     async def get_widget_image(self, style: Optional[str] = "shield") -> str:  # TODO Replace str with ImageURL object
1417 [ 96]         * [``shield``](https://discord.com/api/guilds/81384788765712384/widget.png?style=shield)
1419 [ 98]         * [``banner1``](https://discord.com/api/guilds/81384788765712384/widget.png?style=banner1)
1422 [ 98]         * [``banner2``](https://discord.com/api/guilds/81384788765712384/widget.png?style=banner2)
1425 [ 98]         * [``banner3``](https://discord.com/api/guilds/81384788765712384/widget.png?style=banner3)
1429 [ 98]         * [``banner4``](https://discord.com/api/guilds/81384788765712384/widget.png?style=banner4)

EDIT: Removed the ones below 88 chars

pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
@Enderchief
Copy link
Member Author

@trag1c is the number on the side the line length? If so, the comments and padded white space should not count. Also if types in the docstring are over it's fine.

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
@trag1c
Copy link
Member

trag1c commented Dec 8, 2021

@trag1c is the number on the side the line length? If so, the comments and padded white space should not count. Also if types in the docstring are over it's fine.

is the number on the side the line length?

the one in the brackets, yes

padded white space should not count

do you mean excluding indentation?

Also if types in the docstring are over it's fine.

I have excluded types in docstrings I think (used my script I mentioned with | grep -v :class: so all stuff like this should be excluded) 😄

@Enderchief
Copy link
Member Author

do you mean excluding indentation?
my bad. whitespace does
💀

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Copy link
Member

@trag1c trag1c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't the -> None returns have to be removed or something?

Listed them if so: L762, L785, L807

pincer/objects/guild/guild.py Outdated Show resolved Hide resolved
@Enderchief
Copy link
Member Author

Enderchief commented Dec 10, 2021

Don't the -> None returns have to be removed or something?
Listed them if so:
L762, L785, L807

I am not sure? @Lunarmagpie @Sigmanificient what do you think?

Edit: You know what. I'm removing them to stay consistent with other functions.

@trag1c trag1c merged commit e5c7d75 into Pincer-org:main Dec 11, 2021
VincentRPS added a commit to VincentRPS/Pincer that referenced this pull request Dec 15, 2021
* ✨ Added sticker support

* 🎨 Improving formatting

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Improving formatting

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Improving formatting

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Improving formatting

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Improving formatting

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🏷️ annotation on get_sticker

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🏷️ remove annotation on delete_sticker

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 Better `dict` creation

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 Formatting with black

* ⚡ Yield instead of return

* 🎨 Move `sticker_packs` to Client

* 🎨 Apply suggestions from code review

Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>

* ✏️ Typo in pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 AsyncGenerator -> AsyncIterator

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 📝 Spilt docstring to newline

* Update pincer/client.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* ✨ emoji file uploading

* 🎨 remove unused imports

* ✨ created properties

* ✨ added properties to UserMessage

* 🚧 started updates

* 🐛 Missing await

oops. i forgor 💀

* ✨ sticker upadate middleware

* 🐛 added construct client dict to utils __init__.py

* 🐛 prevented middleware from raising exception if guild isn't registered

* 💬 fix typo

* ✨ thread and channel updates

* ✨ caching voice_states

* 📝 add docs

* ✨ Add more guild methods (Pincer-org#275)

* ✨ added `create_channel` and `modify_channel_positions`

* 🐛 Removed a circular import

* 📝 Improve docstring

* 🎨 Added Thread Channel Types

* 🎨 Added Thread types to `__init__`

* ✨ added more guild methods

* ✨ added more guild methods

* 📝 fix docstrings

* 📝 Fixed some docstrings

* ♻️ Fixed issues

* ✏️ Typo in pincer/objects/guild/guild.py

Co-authored-by: RPS <vincentbusiness55@gmail.com>

* 🎨 Apply suggestions from review

Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>

* 🎨 Clean guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 list_active_threads is a generator

* 🎨 list_guild_members returns generator

* 🎨 Typing changes, fixed docstrings, fixed issues

* 🎨 format string

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 Change format string

* ✨ Added `X-Audit-Log-Reason` to guild methods

* ⚡ Change return to yield

* Update pincer/objects/guild/guild.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🐛 Fixed typos

* 🐛 Wrong bracket

Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* 🐛 Change calling to appending string

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

🎨 Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 Fixed line length and issues

* 🎨 Added missing typing

* Update pincer/objects/guild/guild.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 Split long lines

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 Removed `-> None`

Co-authored-by: RPS <vincentbusiness55@gmail.com>
Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>

* 🎨 changed properties to classes

* ✨ added channel properties

* ✨ added guild properties

* ✨ added guild_ids property to Client

* 🎨 codacity changes

* 📝 updated docs

* 💬 fix typo

* 🧑‍💻 made Intents easier to use

* 🎨 ran black on middleware

* 📝 maked guild_ids return type as List[Snowflake]

* 🐛 setup fix

* Update pincer/middleware/interaction_create.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 fixed formatting to work with 88 char line length

* ♻️ Update pincer/middleware/stage_instance_delete.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* ♻️ Update pincer/middleware/thread_delete.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 🎨 fixed formatting to work with 88 char line length

* 🎨 fixed formatting to work with 88 char line length

* ♻️ Update pincer/middleware/channel_delete.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* ♻️ Update pincer/middleware/guild_role_delete.py

Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>

* 📝 added ctx to examples

* 🐛 APIObject _client is now correctly propogated to children.

* 🐛 ThreadMember now has correct args

* 📝 ctx.channel.send is now awaited

* 🎨 added missing await

* 🎨 removed unused import

* 🐛 uses recursion to transform all `APIObject` objects into JSON serializable

* 🎨 using defaultdict

* 🐛 I don't know wky my IDE changed all `@dataclass(repr=False)` with `@dataclass`

* 🎨 changed typing

* 🔨 Automatic update of setup.cfg

* Adding Visual Studio Configs To gitignore

* 🎨 Automatic  sorting

* 🐛 Fix Python 3.10 (Pincer-org#310)

* Fix for Pincer-org#303
* Move to type checking

* 🔖 0.14.0

* 🔨 Automatic update of setup.cfg

Co-authored-by: endercheif <reet22singh@gmail.com>
Co-authored-by: Endercheif <45527309+Endercheif@users.noreply.github.com>
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: Lunarmagpie <65521138+Lunarmagpie@users.noreply.github.com>
Co-authored-by: Lunarmagpie <Bambolambo0@gmail.com>
Co-authored-by: sigmanificient <sigmanificient@gmail.com>
Co-authored-by: drawbu <drawbu@github.com>
Co-authored-by: GitHub Actions <actions@pincer.dev>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Implement Guild Methods
5 participants