Skip to content
Open
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
15 changes: 7 additions & 8 deletions tags/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ async def tags(self, ctx: commands.Context):
await ctx.send_help(ctx.command)

@tags.command()
async def add(self, ctx: commands.Context, name: str, *, content: str):
async def add(self, ctx: commands.Context, name: commands.clean_content, *, content: commands.clean_content):
"""
Make a new tag
"""
if (await self.find_db(name=name)) is not None:
await ctx.send(f":x: | Tag with name `{name}` already exists!")
return
else:
ctx.message.content = content
await self.db.insert_one(
{
"name": name,
"content": ctx.message.clean_content,
"content": content,
"createdAt": datetime.utcnow(),
"updatedAt": datetime.utcnow(),
"author": ctx.author.id,
Expand All @@ -47,7 +46,7 @@ async def add(self, ctx: commands.Context, name: str, *, content: str):
return

@tags.command()
async def edit(self, ctx: commands.Context, name: str, *, content: str):
async def edit(self, ctx: commands.Context, name: commands.clean_content, *, content: commands.clean_content):
"""
Edit an existing tag

Expand All @@ -73,7 +72,7 @@ async def edit(self, ctx: commands.Context, name: str, *, content: str):
await ctx.send("You don't have enough permissions to edit that tag")

@tags.command()
async def delete(self, ctx: commands.Context, name: str):
async def delete(self, ctx: commands.Context, name: commands.clean_content):
"""
Delete a tag.

Expand All @@ -96,7 +95,7 @@ async def delete(self, ctx: commands.Context, name: str):
await ctx.send("You don't have enough permissions to delete that tag")

@tags.command()
async def claim(self, ctx: commands.Context, name: str):
async def claim(self, ctx: commands.Context, name: commands.clean_content):
"""
Claim a tag if the user has left the server
"""
Expand All @@ -122,7 +121,7 @@ async def claim(self, ctx: commands.Context, name: str):
)

@tags.command()
async def info(self, ctx: commands.Context, name: str):
async def info(self, ctx: commands.Context, name: commands.clean_content):
"""
Get info on a tag
"""
Expand All @@ -147,7 +146,7 @@ async def info(self, ctx: commands.Context, name: str):
return

@commands.command()
async def tag(self, ctx: commands.Context, name: str):
async def tag(self, ctx: commands.Context, name: commands.clean_content):
"""
Use a tag!
"""
Expand Down