File tree Expand file tree Collapse file tree 5 files changed +16
-2
lines changed Expand file tree Collapse file tree 5 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 108
108
# MacOS
109
109
.DS_Store
110
110
111
+ # custom
112
+ .vscode /
113
+
111
114
# Modmail
112
115
config.json
113
116
plugins /
Original file line number Diff line number Diff line change 40
40
from motor .motor_asyncio import AsyncIOMotorClient
41
41
42
42
from core .changelog import ChangeLog
43
- from core .clients import ModmailApiClient , SelfHostedClient
43
+ from core .clients import ModmailApiClient , SelfHostedClient , PluginDatabaseClient
44
44
from core .config import ConfigManager
45
45
from core .models import Bot
46
46
from core .thread import ThreadManager
@@ -65,6 +65,7 @@ def __init__(self):
65
65
self ._api = SelfHostedClient (self )
66
66
else :
67
67
self ._api = ModmailApiClient (self )
68
+ self .plugin_db = PluginDatabaseClient (self )
68
69
69
70
self .data_task = self .loop .create_task (self .data_loop ())
70
71
self .autoupdate_task = self .loop .create_task (self .autoupdate_loop ())
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ async def download_initial_plugins(self):
52
52
async def download_plugin_repo (username , repo ):
53
53
try :
54
54
cmd = f'git clone https://github.com/{ username } /{ repo } '
55
- cmd += 'plugins/{username}-{repo} -q'
55
+ cmd += f 'plugins/{ username } -{ repo } -q'
56
56
subprocess .run (cmd , check = True , capture_output = True )
57
57
# -q (quiet) so there's no terminal output unless there's an error
58
58
except subprocess .CalledProcessError as exc :
Original file line number Diff line number Diff line change 1
1
from discord .ext import commands
2
2
3
+
3
4
def has_permissions (** perms ):
4
5
"""Check if the author has required permissions.
5
6
This will always return ``True`` if the author is a bot owner, or
Original file line number Diff line number Diff line change @@ -381,3 +381,12 @@ async def get_user_info(self):
381
381
'url' : user .url
382
382
}
383
383
}
384
+
385
+
386
+ class PluginDatabaseClient :
387
+ def __init__ (self , bot : Bot ):
388
+ self .bot = bot
389
+
390
+ def get_partition (self , cog_cls ):
391
+ cls_name = cog_cls .__class__ .__name__
392
+ return self .bot .db .plugins [cls_name ]
You can’t perform that action at this time.
0 commit comments