Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com>
  • Loading branch information
Lulalaby and Dorukyum authored Aug 9, 2022
1 parent 63783bd commit 3db3935
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -1573,16 +1573,16 @@ async def delete(self) -> None:
"""
await self._state.http.delete_guild(self.id)

async def set_mfa_required(self, toggle: bool, *, reason: str = None):
async def set_mfa_required(self, required: bool, *, reason: str = None) -> None:
"""|coro|
Set whether it is required to have MFA enabled on your account
to perform moderation actions. You must be the guild owner to do this.
Parameters
-----------
toggle: :class:`bool`
Whether it should be required.
required: :class:`bool`
Whether MFA should be required to perform moderation actions.
reason: :class:`str`
The reason to show up in the audit log.
Expand All @@ -1593,7 +1593,7 @@ async def set_mfa_required(self, toggle: bool, *, reason: str = None):
Forbidden
You are not the owner of the guild.
"""
await self._state.http.edit_guild_mfa(self.id, toggle, reason=reason)
await self._state.http.edit_guild_mfa(self.id, required, reason=reason)

async def edit(
self,
Expand Down
4 changes: 2 additions & 2 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,10 +1334,10 @@ def edit_guild(self, guild_id: Snowflake, *, reason: Optional[str] = None, **fie
reason=reason,
)

def edit_guild_mfa(self, guild_id: Snowflake, toggle: bool, *, reason: Optional[str]) -> Response[guild.GuildMFAModify]:
def edit_guild_mfa(self, guild_id: Snowflake, required: bool, *, reason: Optional[str]) -> Response[guild.GuildMFAModify]:
return self.request(
Route("POST", "/guilds/{guild_id}/mfa", guild_id=guild_id),
json={"level": int(toggle)},
json={"level": int(required)},
reason=reason
)

Expand Down

0 comments on commit 3db3935

Please sign in to comment.