Skip to content

Commit b6b9e6c

Browse files
committed
Updated version, deps, and plugins code
1 parent d6ba02e commit b6b9e6c

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html);
77
however, insignificant breaking changes do not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319). If you're a plugin developer, note the "BREAKING" section.
88

9+
10+
# v3.8.6
11+
12+
### Added
13+
14+
- Ability to install local plugins without relying on git / external sources
15+
- Simply add your extension to plugins/@local, and use `?plugin add local/plugin-name`
16+
917
# v3.8.5
1018

1119
### Added

bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.8.5"
1+
__version__ = "3.8.6"
22

33

44
import asyncio

cogs/plugins.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __lt__(self, other):
8686

8787
@classmethod
8888
def from_string(cls, s, strict=False):
89-
m = match(r"^@local/(.+)$", s)
89+
m = match(r"^@?local/(.+)$", s)
9090
if m is None:
9191
if not strict:
9292
m = match(r"^(.+?)/(.+?)/(.+?)(?:@(.+?))?$", s)
@@ -173,7 +173,7 @@ async def initial_load_plugins(self):
173173
await self.bot.config.update()
174174

175175
async def download_plugin(self, plugin, force=False):
176-
if plugin.abs_path.exists() and not force:
176+
if plugin.abs_path.exists() and (not force or plugin.local):
177177
return
178178

179179
if plugin.local:
@@ -314,7 +314,7 @@ async def parse_user_input(self, ctx, plugin_name, check_version=False):
314314
embed = discord.Embed(
315315
description="Invalid plugin name, double check the plugin name "
316316
"or use one of the following formats: "
317-
"username/repo/plugin, username/repo/plugin@branch, @local/plugin.",
317+
"username/repo/plugin-name, username/repo/plugin-name@branch, local/plugin-name.",
318318
color=self.bot.error_color,
319319
)
320320
await ctx.send(embed=embed)
@@ -339,7 +339,7 @@ async def plugins_add(self, ctx, *, plugin_name: str):
339339
340340
`plugin_name` can be the name of the plugin found in `{prefix}plugin registry`,
341341
or a direct reference to a GitHub hosted plugin (in the format `user/repo/name[@branch]`)
342-
or `@local/name` for local plugins.
342+
or `local/name` for local plugins.
343343
"""
344344

345345
plugin = await self.parse_user_input(ctx, plugin_name, check_version=True)
@@ -360,10 +360,16 @@ async def plugins_add(self, ctx, *, plugin_name: str):
360360
)
361361
return await ctx.send(embed=embed)
362362

363-
embed = discord.Embed(
364-
description=f"Starting to download plugin from {plugin.link}...",
365-
color=self.bot.main_color,
366-
)
363+
if plugin.local:
364+
embed = discord.Embed(
365+
description=f"Starting to load local plugin from {plugin.link}...",
366+
color=self.bot.main_color,
367+
)
368+
else:
369+
embed = discord.Embed(
370+
description=f"Starting to download plugin from {plugin.link}...",
371+
color=self.bot.main_color,
372+
)
367373
msg = await ctx.send(embed=embed)
368374

369375
try:
@@ -420,7 +426,7 @@ async def plugins_remove(self, ctx, *, plugin_name: str):
420426
Remove an installed plugin of the bot.
421427
422428
`plugin_name` can be the name of the plugin found in `{prefix}plugin registry`, or a direct reference
423-
to a GitHub hosted plugin (in the format `user/repo/name[@branch]`) or `@local/name` for local plugins.
429+
to a GitHub hosted plugin (in the format `user/repo/name[@branch]`) or `local/name` for local plugins.
424430
"""
425431
plugin = await self.parse_user_input(ctx, plugin_name)
426432
if plugin is None:
@@ -503,7 +509,7 @@ async def plugins_update(self, ctx, *, plugin_name: str = None):
503509
Update a plugin for the bot.
504510
505511
`plugin_name` can be the name of the plugin found in `{prefix}plugin registry`, or a direct reference
506-
to a GitHub hosted plugin (in the format `user/repo/name[@branch]`) or `@local/name` for local plugins.
512+
to a GitHub hosted plugin (in the format `user/repo/name[@branch]`) or `local/name` for local plugins.
507513
508514
To update all plugins, do `{prefix}plugins update`.
509515
"""

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = '''
2121

2222
[tool.poetry]
2323
name = 'Modmail'
24-
version = '3.6.0'
24+
version = '3.8.6'
2525
description = "Modmail is similar to Reddit's Modmail, both in functionality and purpose. It serves as a shared inbox for server staff to communicate with their users in a seamless way."
2626
license = 'AGPL-3.0-only'
2727
authors = [
@@ -36,7 +36,7 @@ keywords = ['discord', 'modmail']
3636

3737
[tool.poetry.dependencies]
3838
python = "^3.7"
39-
"discord.py" = "./discord.py-1.5.2.tar.gz"
39+
"discord.py" = "discord.py==1.6.0"
4040
uvloop = {version = ">=0.12.0", markers = "sys_platform != 'win32'"}
4141
python-dotenv = ">=0.10.3"
4242
parsedatetime = "^2.6"

requirements.min.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
# Generated as of June, 2020
1+
# Generated as of March, 2021
22
# This is the bare minimum requirements.txt for running Modmail.
33
# To install requirements.txt run: pip install -r requirements.min.txt
44

55
aiohttp==3.6.2
6-
async-timeout==3.0.1
7-
attrs==19.3.0
8-
chardet==3.0.4
9-
./discord.py-1.5.2.tar.gz
6+
discord.py==1.6.0
107
dnspython==1.16.0
118
emoji==0.5.4
12-
future==0.18.2
13-
idna==2.9
149
isodate==0.6.0
1510
motor==2.1.0
16-
multidict==4.7.6
1711
natural==0.2.0
1812
parsedatetime==2.6
1913
pymongo==3.10.1
2014
python-dateutil==2.8.1
2115
python-dotenv==0.14.0
22-
six==1.15.0
23-
websockets==8.1
24-
yarl==1.4.2
16+
websockets==8.1

0 commit comments

Comments
 (0)