Skip to content

Commit b2c083f

Browse files
Pull 2 changes from upstream (#14)
* 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 <[email protected]>
1 parent 8de9c38 commit b2c083f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ however, insignificant breaking changes do not guarantee a major version bump, s
4646
- Fixed blocked roles improperly saving in `blocked_users` config.
4747
- Fixed `?block` command improperly parsing reason as timestamp.
4848

49+
### Internal
50+
- `ConfigManager.get` no longer accepts two positional arguments: the `convert` argument is now keyword-only.
51+
4952
# v4.0.2
5053

5154
### Breaking

cogs/plugins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@ async def parse_user_input(self, ctx, plugin_name, check_version=False):
300300
plugin = Plugin(user, repo, plugin_name, branch)
301301

302302
else:
303-
if not self.bot.config.get("registry_plugins_only", False):
303+
if self.bot.config.get("registry_plugins_only"):
304304
embed = discord.Embed(
305-
description="This plugin is not in the registry. "
306-
"To install it, you must set `REGISTRY_PLUGINS_ONLY=false` in your .env file or config settings.",
305+
description="This plugin is not in the registry. To install this plugin, "
306+
"you must set `REGISTRY_PLUGINS_ONLY=no` or remove this key in your .env file.",
307307
color=self.bot.error_color,
308308
)
309309
await ctx.send(embed=embed)

core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def __getitem__(self, key: str) -> typing.Any:
300300
def __delitem__(self, key: str) -> None:
301301
return self.remove(key)
302302

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

0 commit comments

Comments
 (0)