Skip to content

Commit

Permalink
Pull 2 changes from upstream (raidensakura#14)
Browse files Browse the repository at this point in the history
* Fixed unset registry_plugins_only causing non-registry plugins to fail to install

* To avoid confusion, config.get() only accepts one pos argument now

---------

Co-authored-by: Taku <45324516+Taaku18@users.noreply.github.com>
  • Loading branch information
raidensakura and Taaku18 committed Jul 23, 2023
1 parent 8de9c38 commit b2c083f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ however, insignificant breaking changes do not guarantee a major version bump, s
- Fixed blocked roles improperly saving in `blocked_users` config.
- Fixed `?block` command improperly parsing reason as timestamp.

### Internal
- `ConfigManager.get` no longer accepts two positional arguments: the `convert` argument is now keyword-only.

# v4.0.2

### Breaking
Expand Down
6 changes: 3 additions & 3 deletions cogs/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ async def parse_user_input(self, ctx, plugin_name, check_version=False):
plugin = Plugin(user, repo, plugin_name, branch)

else:
if not self.bot.config.get("registry_plugins_only", False):
if self.bot.config.get("registry_plugins_only"):
embed = discord.Embed(
description="This plugin is not in the registry. "
"To install it, you must set `REGISTRY_PLUGINS_ONLY=false` in your .env file or config settings.",
description="This plugin is not in the registry. To install this plugin, "
"you must set `REGISTRY_PLUGINS_ONLY=no` or remove this key in your .env file.",
color=self.bot.error_color,
)
await ctx.send(embed=embed)
Expand Down
2 changes: 1 addition & 1 deletion core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def __getitem__(self, key: str) -> typing.Any:
def __delitem__(self, key: str) -> None:
return self.remove(key)

def get(self, key: str, convert=True) -> typing.Any:
def get(self, key: str, *, convert: bool = True) -> typing.Any:
key = key.lower()
if key not in self.all_keys:
raise InvalidConfigError(f'Configuration "{key}" is invalid.')
Expand Down

0 comments on commit b2c083f

Please sign in to comment.