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

✨ Rewrote command registration and added cogs #389

Merged
merged 82 commits into from
Feb 19, 2022

Conversation

Lunarmagpie
Copy link
Member

@Lunarmagpie Lunarmagpie commented Jan 16, 2022

Changes

  • adds: Cogs. Look at the cog example to see how it works. Also kills old cog system.
  • fixed: Commands and Message Components are registered when a class is initiated. This makes pincer a lot more modular and any class can register a cog now. as long as it inherits from Interactable FUNCTIONAL BOTS WILL BE IMPOSSIBLE IF THIS GETS MERGED. Rewrote and they're possible + better
  • improvements: ...

Check off the following

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

@Pincer-org Pincer-org deleted a comment from sourcery-ai bot Jan 16, 2022
pincer/client.py Outdated Show resolved Hide resolved
pincer/cog.py Outdated Show resolved Hide resolved
pincer/cog.py Outdated Show resolved Hide resolved
pincer/commands/chat_command_handler.py Outdated Show resolved Hide resolved
pincer/commands/interactable.py Outdated Show resolved Hide resolved
Lunarmagpie and others added 4 commits January 16, 2022 13:33
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>
@codecov
Copy link

codecov bot commented Jan 16, 2022

Codecov Report

Merging #389 (ac49e3c) into main (5d5b369) will not change coverage.
The diff coverage is n/a.

❗ Current head ac49e3c differs from pull request most recent head 9fe7bab. Consider uploading reports for the commit 9fe7bab to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #389   +/-   ##
=======================================
  Coverage   91.17%   91.17%           
=======================================
  Files           9        9           
  Lines         102      102           
=======================================
  Hits           93       93           
  Misses          9        9           

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 5d5b369...9fe7bab. Read the comment docs.

@Lunarmagpie Lunarmagpie reopened this Jan 19, 2022
@Lunarmagpie
Copy link
Member Author

Time to be reviewed again 💀

Copy link
Member

@Sigmanificient Sigmanificient left a comment

Choose a reason for hiding this comment

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

I think i've said everything i coulda think of before it was close and reopen

pincer/commands/components/button.py Show resolved Hide resolved
pincer/commands/components/select_menu.py Show resolved Hide resolved
pincer/commands/interactable.py Outdated Show resolved Hide resolved
pincer/commands/interactable.py Outdated Show resolved Hide resolved
pincer/objects/app/command.py Outdated Show resolved Hide resolved
Lunarmagpie and others added 5 commits January 20, 2022 17:39
Co-authored-by: Endercheif <45527309+Endercheif@users.noreply.github.com>
Co-authored-by: Endercheif <45527309+Endercheif@users.noreply.github.com>
pincer/client.py Show resolved Hide resolved
pincer/cog.py Show resolved Hide resolved
pincer/client.py Outdated Show resolved Hide resolved
pincer/cog.py Show resolved Hide resolved
pincer/commands/interactable.py Outdated Show resolved Hide resolved
Comment on lines +104 to +110
return list(
map(
AppCommand.from_dict,
await self.client.http.get(self.__prefix + self.__get)
+ [cmd for guild in guild_commands for cmd in guild],
)
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return list(
map(
AppCommand.from_dict,
await self.client.http.get(self.__prefix + self.__get)
+ [cmd for guild in guild_commands for cmd in guild],
)
)
return [*map(
AppCommand.from_dict,
await self.client.http.get(self.__prefix + self.__get)
+ [cmd for guild in guild_commands for cmd in guild],
)]

Copy link
Member Author

Choose a reason for hiding this comment

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

list is better

pincer/client.py Outdated
Comment on lines 339 to 341
event = InteractableStructure(
call=coroutine
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
event = InteractableStructure(
call=coroutine
)
event = InteractableStructure(call=coroutine)

pincer/commands/chat_command_handler.py Outdated Show resolved Hide resolved
pincer/commands/chat_command_handler.py Outdated Show resolved Hide resolved
Sigmanificient and others added 4 commits January 29, 2022 23:19
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
Co-authored-by: trag1c <77130613+trag1c@users.noreply.github.com>
@Lunarmagpie Lunarmagpie merged commit 35cc1f8 into Pincer-org:main Feb 19, 2022
@Lunarmagpie Lunarmagpie deleted the cogs branch February 19, 2022 22:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants