add back the silent kwarg to message.delete #9

Merged
TheMoksej merged 6 commits from patch-1 into 2.0 2021-08-29 17:57:08 +00:00
TheMoksej commented 2021-08-28 19:47:17 +00:00 (Migrated from github.com)

Summary

Just adding back the old feature to 2.0 :mmlool:

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)
## Summary Just adding back the old feature to 2.0 :mmlool: <!-- What is this pull request for? Does it fix any issues? --> ## Checklist <!-- Put an x inside [ ] to check it, like so: [x] --> - [ ] If code changes were made then they have been tested. - [ ] I have updated the documentation to reflect the changes. - [ ] This PR fixes an issue. - [ ] This PR adds something new (e.g. new method or parameters). - [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed) - [ ] This PR is **not** a code change (e.g. documentation, README, ...)
paris-ci (Migrated from github.com) reviewed 2021-08-28 19:50:40 +00:00
paris-ci (Migrated from github.com) commented 2021-08-28 19:50:40 +00:00

..versionadded:: 2.0

..versionadded:: 2.0
justanotherbyte commented 2021-08-28 20:15:05 +00:00 (Migrated from github.com)
            except Exception as e:
                if silent:
                    pass
                else:
                    raise e

can be shortened to:

            except Exception as e:
                if not silent:
                    raise e
```py except Exception as e: if silent: pass else: raise e ``` can be shortened to: ```py except Exception as e: if not silent: raise e ```
TheMoksej commented 2021-08-28 20:16:01 +00:00 (Migrated from github.com)
            except Exception as e:
                if silent:
                    pass
                else:
                    raise e

can be shortened to:

            except Exception as e:
                if not silent:
                    raise e

That's already done 2bc75d5

> ```python > except Exception as e: > if silent: > pass > else: > raise e > ``` > > can be shortened to: > > ```python > except Exception as e: > if not silent: > raise e > ``` That's already done [2bc75d5](https://github.com/iDevision/enhanced-discord.py/pull/9/commits/2bc75d51eadbd10fa357fa064d88a14f67393afe)
justanotherbyte commented 2021-08-28 20:18:32 +00:00 (Migrated from github.com)

ah, my bad

ah, my bad
TheMoksej commented 2021-08-28 20:20:16 +00:00 (Migrated from github.com)

Nah, it's my bad for not noticing it in the first place, just kinda copy-pasted the old code.

Nah, it's my bad for not noticing it in the first place, just kinda copy-pasted the old code.
NiumXp (Migrated from github.com) reviewed 2021-08-28 21:54:15 +00:00
NiumXp (Migrated from github.com) commented 2021-08-28 21:54:14 +00:00

You are not using the error, so, you can do

            except Exception:
                if not silent:
                    raise
You are not using the error, so, you can do ```py except Exception: if not silent: raise ```
TheMoksej (Migrated from github.com) reviewed 2021-08-28 22:02:50 +00:00
TheMoksej (Migrated from github.com) commented 2021-08-28 22:02:50 +00:00

Good point, let me change that

Good point, let me change that
paris-ci (Migrated from github.com) reviewed 2021-08-28 22:12:40 +00:00
paris-ci (Migrated from github.com) commented 2021-08-28 22:12:40 +00:00

Wait yeah, I was wrong before. It's versionchanged.

        .. versionchanged:: 2.0
Wait yeah, I was wrong before. It's versionchanged. ```suggestion .. versionchanged:: 2.0 ```
NiumXp (Migrated from github.com) reviewed 2021-08-28 22:24:25 +00:00
NiumXp (Migrated from github.com) commented 2021-08-28 22:24:25 +00:00

The usage of Optional is wrong.

    async def delete(self, *, delay: Optional[float] = None, silent: bool = False) -> None:

If a parameter has a default value different to None (and use it for anything), it is not an optional parameter.

The usage of `Optional` is wrong. ```suggestion async def delete(self, *, delay: Optional[float] = None, silent: bool = False) -> None: ``` If a parameter has a default value different to `None` (and use it for anything), it is not an optional parameter.
IAmTomahawkx (Migrated from github.com) approved these changes 2021-08-29 17:56:51 +00:00
Sign in to join this conversation.
No description provided.