Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
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
9 changes: 6 additions & 3 deletions cogs/afk.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,35 @@ def __init__(self, bot):

@afk_system.command(
name="set",
description="Sets your AFK status with a custom response"
description="Sets your AFK status with a custom response."
)
@commands.guild_only()
@option(name="response", description="What do you want your AFK response to be?", type=str, default="I'm AFK")
async def afk_set(self, ctx: ApplicationContext, response: str="I'm AFK"):
"""Sets your AFK status with a custom response."""
presence.add_afk(ctx.guild.id, ctx.user.id, response)
localembed = discord.Embed(title=f"{ctx.author.display_name} is now AFK.", description=f"Response: {response}", color=discord.Color.dark_orange())
await ctx.respond(embed=localembed)

@afk_system.command(
name="remove",
description="Removes your AFK status"
description="Removes your AFK status."
)
@commands.guild_only()
async def afk_remove(self, ctx: ApplicationContext):
"""Removes your AFK status."""
status = presence.remove_afk(ctx.guild.id, ctx.author.id)
if status == 0: return await ctx.respond(f"Alright {ctx.author.mention}, I've removed your AFK.")
elif status == 1: return await ctx.respond("You weren't previously AFK.", ephemeral=True)

@afk_system.command(
name="mod_remove",
description="Removes an AFK status for someone else"
description="Removes an AFK status for someone else."
)
@commands.guild_only()
@option(name="user", description="Whose AFK status do you want to remove?", type=discord.User)
async def afk_mod_remove(self, ctx: ApplicationContext, user:discord.User):
"""Removes an AFK status for someone else."""
if not ctx.author.guild_permissions.manage_messages: return await ctx.respond("You don't have the required permissions to use this.", ephemeral=True)
status = presence.remove_afk(ctx.guild.id, user.id)
if status == 0: return await ctx.respond(f"{user.display_name}'s AFK has been removed.")
Expand Down
40 changes: 27 additions & 13 deletions cogs/automod.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ def __init__(self, bot):

@automod_cmds.command(
name="config",
description="Shows the current automod configuration for your server"
description="Shows the current automod configuration for your server."
)
@commands.guild_only()
async def automod_config(self, ctx: ApplicationContext):
"""Shows the current automod configuration for your server."""
loaded_config = automod.fetch_config(ctx.guild.id)
localembed = discord.Embed(title=f"{ctx.guild.name}\'s automod configuration", description="Use the `/automod_set` command to change your server's automod configuration.", color=color)
localembed.set_thumbnail(url=ctx.guild.icon)
Expand All @@ -35,11 +36,12 @@ async def automod_config(self, ctx: ApplicationContext):
# Swear-filter Commands
@automod_cmds.command(
name="swearfilter",
description="Turn on or off automod's swear-filter in your server"
description="Turn on or off automod's swear-filter in your server."
)
@commands.guild_only()
@option(name="toggle", description="Do you want to turn it on or off?", type=bool)
async def automod_swearfilter(self, ctx: ApplicationContext, toggle: bool):
"""Turn on or off automod's swear-filter in your server."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
if automod.fetch_config(ctx.guild.id)["swear_filter"]["enabled"] == toggle: return await ctx.respond(f"That automod option is already set to `{toggle}`.", ephemeral=True)
automod.swearfilter_enabled(ctx.guild.id, toggle)
Expand All @@ -48,11 +50,12 @@ async def automod_swearfilter(self, ctx: ApplicationContext, toggle: bool):

@automod_cmds.command(
name="use_default_keywords",
description="Choose whether or not you want to use the default keywords for automod's swear-filter"
description="Choose whether or not you want to use the default keywords for automod's swear-filter."
)
@commands.guild_only()
@option(name="toggle", description="Do you want to turn it on or off?", type=bool)
async def automod_use_default_keywords(self, ctx: ApplicationContext, toggle: bool):
"""Choose whether or not you want to use the default keywords for automod's swear-filter."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
if automod.fetch_config(ctx.guild.id)["swear_filter"]["keywords"]["use_default"] == toggle: return await ctx.respond(f"That automod option is already set to `{toggle}`.", ephemeral=True)
automod.swearfilter_usedefaultkeywords(ctx.guild.id, toggle)
Expand All @@ -61,10 +64,11 @@ async def automod_use_default_keywords(self, ctx: ApplicationContext, toggle: bo

@automod_cmds.command(
name="view_custom_keywords",
description="Shows a list of the custom automod swear-filter keywords set for your server",
description="Shows a list of the custom automod swear-filter keywords set for your server.",
)
@commands.guild_only()
async def automod_view_custom_keywords(self, ctx: ApplicationContext):
"""Shows a list of the custom automod swear-filter keywords set for your server."""
loaded_config = automod.fetch_config(ctx.guild.id)
out = ""
if loaded_config["swear_filter"]["keywords"]["custom"] != []:
Expand All @@ -79,11 +83,12 @@ async def automod_view_custom_keywords(self, ctx: ApplicationContext):

@automod_cmds.command(
name="add_custom_keyword",
description="Adds a custom keyword to your server's swear-filter"
description="Adds a custom keyword to your server's swear-filter."
)
@commands.guild_only()
@option(name="keyword", description="What keyword do you want to add?", type=str)
async def automod_add_custom_keyword(self, ctx: ApplicationContext, keyword:str):
async def automod_add_custom_keyword(self, ctx: ApplicationContext, keyword: str):
"""Adds a custom keyword to your server's swear-filter."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
loaded_config = automod.fetch_config(ctx.guild.id)
if keyword not in loaded_config["swear_filter"]["keywords"]["custom"]:
Expand All @@ -94,11 +99,12 @@ async def automod_add_custom_keyword(self, ctx: ApplicationContext, keyword:str)

@automod_cmds.command(
name="remove_custom_keyword",
description="Removes a custom keyword (matching its id) from your server's swear-filter"
description="Removes a custom keyword (matching its id) from your server's swear-filter."
)
@commands.guild_only()
@option(name="id", description="What's the id of the keyword to remove (can be found through /automod_view_custom_keywords", type=int)
async def automod_remove_custom_keyword(self, ctx: ApplicationContext, id: int):
"""Removes a custom keyword (matching its id) from your server's swear-filter."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
try:
automod.swearfilter_removekeyword(ctx.guild.id, id)
Expand All @@ -108,11 +114,12 @@ async def automod_remove_custom_keyword(self, ctx: ApplicationContext, id: int):
# Link Blocker Commands
@automod_cmds.command(
name="linkblocker",
description="Turn on or off automod's link blocker in your server"
description="Turn on or off automod's link blocker in your server."
)
@commands.guild_only()
@option(name="toggle", description="Do you want to turn it on or off?", type=bool)
async def automod_linkblocker(self, ctx: ApplicationContext, toggle: bool):
"""Turn on or off automod's link blocker in your server."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
if automod.fetch_config(ctx.guild.id)["link_blocker"]["enabled"] == toggle: return await ctx.respond(f"That automod option is already set to `{toggle}`.", ephemeral=True)
automod.linkblocker_enabled(ctx.guild.id, toggle)
Expand All @@ -121,11 +128,12 @@ async def automod_linkblocker(self, ctx: ApplicationContext, toggle: bool):

@automod_cmds.command(
name="linkblocker_only_whitelisted",
description="Only allows whitelisted links in the server and blocks all other links"
description="Only allows whitelisted links in the server and blocks all other links."
)
@commands.guild_only()
@option(name="toggle", description="Do you want to turn it on or off?", type=bool)
async def automod_linkblocker_only_whitelisted_links(self, ctx: ApplicationContext, toggle: bool):
"""Only allows whitelisted links in the server and blocks all other links."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
if automod.fetch_config(ctx.guild.id)["link_blocker"]["use_whitelist_only"] == toggle: return await ctx.respond(f"That automod option is already set to `{toggle}`.", ephemeral=True)
automod.linkblocker_enabled(ctx.guild.id, toggle)
Expand All @@ -139,6 +147,7 @@ async def automod_linkblocker_only_whitelisted_links(self, ctx: ApplicationConte
@commands.guild_only()
@option(name="link", description="The link that you want to add (must be in form of https://{url})", type=str)
async def automod_linkblocker_add_whitelist(self, ctx: ApplicationContext, link: str):
"""Adds a link to your server link blocker's whitelist."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
if link in automod.fetch_config(ctx.guild.id)["link_blocker"]["whitelist"]: return await ctx.respond("This link is already in your server's link blocker whitelist.", ephemeral=True)
if "https://" in link or "http://" in link:
Expand All @@ -153,6 +162,7 @@ async def automod_linkblocker_add_whitelist(self, ctx: ApplicationContext, link:
@commands.guild_only()
@option(name="link", description="The link that you want to add (must be in form of https://{url})", type=str)
async def automod_linkblocker_add_blacklist(self, ctx: ApplicationContext, link: str):
"""Adds a link to your server link blocker's blacklist."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
if link in automod.fetch_config(ctx.guild.id)["link_blocker"]["blacklist"]: return await ctx.respond("This link is already in your server's link blocker blacklist.", ephemeral=True)
if "https://" in link or "http://" in link:
Expand All @@ -162,10 +172,11 @@ async def automod_linkblocker_add_blacklist(self, ctx: ApplicationContext, link:

@automod_cmds.command(
name="linkblocker_view_whitelisted",
description="Shows a list of the whitelisted links set for this server",
description="Shows a list of the whitelisted links set for this server.",
)
@commands.guild_only()
async def automod_view_custom_keywords(self, ctx: ApplicationContext):
"""Shows a list of the whitelisted links set for this server."""
loaded_config = automod.fetch_config(ctx.guild.id)
out = ""
if loaded_config["link_blocker"]["whitelisted"] != []:
Expand All @@ -180,10 +191,11 @@ async def automod_view_custom_keywords(self, ctx: ApplicationContext):

@automod_cmds.command(
name="linkblocker_view_blacklisted",
description="Shows a list of the blacklisted links set for this server",
description="Shows a list of the blacklisted links set for this server.",
)
@commands.guild_only()
async def automod_view_custom_keywords(self, ctx: ApplicationContext):
"""Shows a list of the blacklisted links set for this server."""
loaded_config = automod.fetch_config(ctx.guild.id)
out = ""
if loaded_config["link_blocker"]["blacklisted"] != []:
Expand All @@ -198,11 +210,12 @@ async def automod_view_custom_keywords(self, ctx: ApplicationContext):

@automod_cmds.command(
name="linkblocker_remove_blacklist",
description="Removes a blacklisted link (matching its id) from this server's link blocker"
description="Removes a blacklisted link (matching its id) from this server's link blocker."
)
@commands.guild_only()
@option(name="id", description="What's the id of the link to remove? (can be found through /automod_view_blacklisted_links", type=int)
async def automod_linkblocker_remove_blacklist(self, ctx: ApplicationContext, id: int):
"""Removes a blacklisted link (matching its id) from this server's link blocker."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
try:
automod.linkblocker_remove_blacklisted(ctx.guild.id, id)
Expand All @@ -211,11 +224,12 @@ async def automod_linkblocker_remove_blacklist(self, ctx: ApplicationContext, id

@automod_cmds.command(
name="linkblocker_remove_whitelist",
description="Removes a whitelisted link (matching its id) from this server's link blocker"
description="Removes a whitelisted link (matching its id) from this server's link blocker."
)
@commands.guild_only()
@option(name="id", description="What's the id of the link to remove? (can be found through /automod_view_whitelisted_links", type=int)
async def automod_linkblocker_remove_whitelist(self, ctx: ApplicationContext, id: int):
"""Removes a whitelisted link (matching its id) from this server's link blocker."""
if not ctx.author.guild_permissions.administrator: return await ctx.respond("You cannot use this command. If you think this is a mistake, please contact your server owner/administrator.", ephemeral=True)
try:
automod.linkblocker_remove_whitelisted(ctx.guild.id, id)
Expand Down
5 changes: 4 additions & 1 deletion cogs/devtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ def __init__(self, bot):

@devtools.command(
name='modify_balance',
description="Modifies user balance (Normal Digit: Adds Balance; Negative Digit: Removes Balance)"
description="Modifies user balance. (Normal Digit: Adds Balance; Negative Digit: Removes Balance)"
)
@option(name="user", description="Specify the user to change their balance", type=discord.User)
@option(name="modifier", description="Specify the balance to modify", type=int)
async def modify_balance(self, ctx: ApplicationContext, user: discord.User, modifier: int):
"""Modifies user balance. (Normal Digit: Adds Balance; Negative Digit: Removes Balance)"""
if str(ctx.author.id) not in fetch_superusers(): return ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
try:
currency.add(user.id, modifier)
Expand All @@ -46,6 +47,7 @@ async def modify_balance(self, ctx: ApplicationContext, user: discord.User, modi
@option(name="user", description="Who's rank do you want to edit?", type=discord.User)
@option(name="new_rank", description="The new rank you want to set for the user", type=int)
async def edit_rank(self, ctx: ApplicationContext, user: discord.User, new_rank: int):
"""Edits a user's rank."""
if str(ctx.author.id) not in fetch_superusers(): return await ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
try:
levelling.set_level(user.id, new_rank)
Expand All @@ -59,6 +61,7 @@ async def edit_rank(self, ctx: ApplicationContext, user: discord.User, new_rank:
@option(name="user", description="Who's rank do you want to edit?", type=discord.User)
@option(name="new_xp", description="The new xp count you want to set for the user", type=int)
async def edit_xp(self, ctx: ApplicationContext, user: discord.User, new_xp: int):
"""Edits a user's XP."""
if str(ctx.author.id) not in fetch_superusers(): return await ctx.respond("This command is usable only by **developers** and **bot superusers**.", ephemeral=True)
try:
levelling.set_xp(user.id, new_xp)
Expand Down
3 changes: 2 additions & 1 deletion cogs/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ def __init__(self, bot):

@commands.slash_command(
name='stroketranslate',
description='Gives you the ability to make full words and sentences from a cluster of letters'
description='Gives you the ability to make full words and sentences from a cluster of letters!'
)
@option(name="strok", description="What do you want to translate?", type=str)
async def stroketranslate(self, ctx: ApplicationContext, strok: str):
"""Gives you the ability to make full words and sentences from a cluster of letters!"""
if len(strok) > 300: return await ctx.respond("Please use no more than `300` character length", ephemeral=True)
else:
with open(f"{client_data_dir}/config/words.json", "r", encoding="utf-8") as f: words = json.load(f)
Expand Down
3 changes: 2 additions & 1 deletion cogs/isobank.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ def __init__(self, bot):

@commands.slash_command(
name="isobank_register",
description="Registers a new IsoBank account with your Discord ID"
description="Registers a new IsoBank account with your Discord ID."
)
@option(name="pin", description="Your new account's authentication ID. Must be a 6-digit integer.", type=int)
async def isobank_register(self, ctx: ApplicationContext, pin:int):
"""Registers a new IsoBank account with your Discord ID."""
isobankauth.register(ctx.author.id, pin)
await ctx.respond("Congratulations! Your new IsoBank account has been registered.", ephemeral=True)

Expand Down
Loading