Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions cogs/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ async def sync(self, ctx: commands.Context[CodingBot]):
@commands.command(name='load', aliases=['l'])
@commands.is_owner()
async def _load(self, ctx: commands.Context[CodingBot], cog_: str):
"""
Load a cog

Usage:
------
`{prefix}load [cog]`
"""
try:
await self.bot.load_extension(cog_)
embed = discord.Embed(
Expand All @@ -55,6 +62,14 @@ async def _load(self, ctx: commands.Context[CodingBot], cog_: str):
@commands.command(name='unload', aliases=['u'])
@commands.is_owner()
async def _unload(self, ctx: commands.Context[CodingBot], cog_: str):
"""
Unload a cog

Usage:
------
`{prefix}unload [cog]`

"""
try:
await self.bot.unload_extension(cog_)
embed = discord.Embed(
Expand All @@ -73,6 +88,13 @@ async def _unload(self, ctx: commands.Context[CodingBot], cog_: str):
@commands.command(name='reload', aliases=['r'])
@commands.is_owner()
async def _reload(self, ctx: commands.Context[CodingBot], cog_: str):
"""
Reload a cog

Usage:
------
`{prefix}reload [cog]`
"""
try:
await self.bot.reload_extension(cog_)
embed = discord.Embed(
Expand All @@ -91,6 +113,14 @@ async def _reload(self, ctx: commands.Context[CodingBot], cog_: str):
@commands.command(name='loadall', aliases=['la'])
@commands.is_owner()
async def _loadall(self, ctx: commands.Context[CodingBot]):
"""
Load all cogs

Usage:
------
`{prefix}loadall`

"""
data = os.listdir('./cogs')
cogs: Dict[str, List[str]] = {
'loaded': [],
Expand All @@ -114,6 +144,14 @@ async def _loadall(self, ctx: commands.Context[CodingBot]):
@commands.command(name='unloadall', aliases=['ua', 'uall'])
@commands.is_owner()
async def _unloadall(self, ctx: commands.Context[CodingBot]):
"""
Unload all cogs

Usage:
------
`{prefix}unloadall`

"""
cogs: Dict[str, List[str]] = {
'unloaded': [],
'not': []
Expand All @@ -133,6 +171,14 @@ async def _unloadall(self, ctx: commands.Context[CodingBot]):
@commands.command(name='reloadall', aliases=['ra', 'rall'])
@commands.is_owner()
async def _reloadall(self, ctx: commands.Context[CodingBot]):
"""
Reload all cogs

Usage:
------
`{prefix}reloadall`

"""
cogs: Dict[str, List[str]] = {
'reloaded': [],
'not': []
Expand All @@ -153,6 +199,16 @@ async def _reloadall(self, ctx: commands.Context[CodingBot]):
@commands.command(name='getusermetric', aliases=['gum'], hidden=True)
@commands.is_owner()
async def _getusermetric(self, ctx: commands.Context[CodingBot], member: discord.Member):
"""
Get user metric

Usage:
------
`{prefix}getusermetric [member]`

"""
member = member or ctx.author

record = await self.bot.conn.select_record(
'thanks',
table='thanks_info',
Expand Down
Loading