Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

refactor 💥: The kwargening #697

Merged
merged 3 commits into from
Oct 27, 2022
Merged

refactor 💥: The kwargening #697

merged 3 commits into from
Oct 27, 2022

Conversation

LordOfPolls
Copy link
Member

What type of pull request is this?

  • Non-breaking code change
  • Breaking code change
  • Documentation change/addition
  • Tests change

Description

Makes all edit and send methods use kwargs for most™️ parameters

Changes

As above

Checklist

  • I've formatted my code with Black
  • I've ensured my code works on Python 3.10.x
  • I've tested my code

@LordOfPolls LordOfPolls added the Improvement Something that is already implemented but can be done better label Oct 25, 2022
Copy link
Contributor

@AlbertUnruh AlbertUnruh left a comment

Choose a reason for hiding this comment

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

Correct me if I'm wrong, but you missed these:

async def edit_origin(
self,
content: str = None,
embeds: Optional[Union[Iterable[Union["Embed", dict]], Union["Embed", dict]]] = None,
embed: Optional[Union["Embed", dict]] = None,
components: Optional[
Union[
Iterable[Iterable[Union["BaseComponent", dict]]],
Iterable[Union["BaseComponent", dict]],
"BaseComponent",
dict,
]
] = None,
allowed_mentions: Optional[Union["AllowedMentions", dict]] = None,
files: Optional[Union[UPLOADABLE_TYPE, Iterable[UPLOADABLE_TYPE]]] = None,
file: Optional[UPLOADABLE_TYPE] = None,
tts: bool = False,
) -> "Message":

async def edit_message(
self,
message: Union["Message", "Snowflake_Type"],
content: Optional[str] = None,
embeds: Optional[Union[List[Union["Embed", dict]], Union["Embed", dict]]] = None,
components: Optional[
Union[List[List[Union["BaseComponent", dict]]], List[Union["BaseComponent", dict]], "BaseComponent", dict]
] = None,
stickers: Optional[Union[List[Union["Sticker", "Snowflake_Type"]], "Sticker", "Snowflake_Type"]] = None,
allowed_mentions: Optional[Union["AllowedMentions", dict]] = None,
reply_to: Optional[Union["MessageReference", "Message", dict, "Snowflake_Type"]] = None,
files: Optional[Union["UPLOADABLE_TYPE", List["UPLOADABLE_TYPE"]]] = None,
file: Optional["UPLOADABLE_TYPE"] = None,
tts: bool = False,
flags: Optional[Union[int, "MessageFlags"]] = None,
) -> Optional["Message"]:

@silasary
Copy link
Collaborator

This might be the most breaking change of 2.x so far :O

@LordOfPolls
Copy link
Member Author

Correct me if I'm wrong, but you missed these:

async def edit_origin(
self,
content: str = None,
embeds: Optional[Union[Iterable[Union["Embed", dict]], Union["Embed", dict]]] = None,
embed: Optional[Union["Embed", dict]] = None,
components: Optional[
Union[
Iterable[Iterable[Union["BaseComponent", dict]]],
Iterable[Union["BaseComponent", dict]],
"BaseComponent",
dict,
]
] = None,
allowed_mentions: Optional[Union["AllowedMentions", dict]] = None,
files: Optional[Union[UPLOADABLE_TYPE, Iterable[UPLOADABLE_TYPE]]] = None,
file: Optional[UPLOADABLE_TYPE] = None,
tts: bool = False,
) -> "Message":

async def edit_message(
self,
message: Union["Message", "Snowflake_Type"],
content: Optional[str] = None,
embeds: Optional[Union[List[Union["Embed", dict]], Union["Embed", dict]]] = None,
components: Optional[
Union[List[List[Union["BaseComponent", dict]]], List[Union["BaseComponent", dict]], "BaseComponent", dict]
] = None,
stickers: Optional[Union[List[Union["Sticker", "Snowflake_Type"]], "Sticker", "Snowflake_Type"]] = None,
allowed_mentions: Optional[Union["AllowedMentions", dict]] = None,
reply_to: Optional[Union["MessageReference", "Message", dict, "Snowflake_Type"]] = None,
files: Optional[Union["UPLOADABLE_TYPE", List["UPLOADABLE_TYPE"]]] = None,
file: Optional["UPLOADABLE_TYPE"] = None,
tts: bool = False,
flags: Optional[Union[int, "MessageFlags"]] = None,
) -> Optional["Message"]:

You'd be right, I didn't consider those two - I'll amend them shortly

@AstreaTSS AstreaTSS changed the title The kwargening refactor 💥: the kwargening Oct 26, 2022
@AstreaTSS AstreaTSS changed the title refactor 💥: the kwargening refactor💥: The kwargening Oct 26, 2022
@AstreaTSS AstreaTSS changed the title refactor💥: The kwargening refactor 💥: The kwargening Oct 26, 2022
@LordOfPolls LordOfPolls merged commit 3cfb47b into 2.x Oct 27, 2022
@LordOfPolls LordOfPolls deleted the the-kwargening branch October 27, 2022 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Improvement Something that is already implemented but can be done better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants