Skip to content

Commit

Permalink
add lvl 5 requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
LevaniVashadze committed Dec 5, 2023
1 parent 1478744 commit 62e8af6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cogs/Tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Optional

import disnake
from better_profanity import profanity
from disnake import Embed, ApplicationCommandInteraction
from disnake.ext import commands

Expand Down Expand Up @@ -111,6 +112,10 @@ async def create(
content: str = commands.Param(le=1900),
):
name = name.casefold()

if not self.bot.config.roles.lvl_5 in [role.id for role in inter.author.roles]:
return await errorEmb(inter, "You must be Level 5 to make tags")

try:
await self.tags.exists(name, TagAlreadyExists, should=False)
except TagAlreadyExists:
Expand All @@ -123,6 +128,9 @@ async def create(
content,
):
return await errorEmb(inter, "You can't make a tag with an invite")
# if content contains slurs or severe profanity
elif profanity.contains_profanity(content):
return await errorEmb(inter, "You can't make a tag with slurs or profanity")
elif not await self.valid_name(name):
return (
await QuickEmb(
Expand Down
3 changes: 3 additions & 0 deletions utils/CONSTANTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ class Roles:
yt_announcements: int = 1010237178036633670
birthday: int = 1044883332548280360
nitro: int = 970695593913647144
lvl_5: int = 1018062723214491668

@classmethod
def dev(cls):
cls.staff: int = 985943266115584010
cls.yt_announcements: int = 1007202835957563412 # dummy role
cls.birthday: int = 1007202835957563412 # dummy role
cls.nitro: int = 1007202835957563412 # dummy role
cls.lvl_5: int = 1007202835957563412 # dummy role
return cls


Expand Down

0 comments on commit 62e8af6

Please sign in to comment.