mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
feat(owner): co owners yayy
This commit is contained in:
15
utils/checks.py
Normal file
15
utils/checks.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import os
|
||||
from discord.ext import commands
|
||||
|
||||
def get_owner_friend_ids():
|
||||
owner_friends = os.getenv("OWNER_FRIENDS", "")
|
||||
if not owner_friends.strip():
|
||||
return []
|
||||
return [int(id.strip()) for id in owner_friends.split(",") if id.strip().isdigit()]
|
||||
|
||||
def is_owner_or_friend():
|
||||
async def predicate(ctx):
|
||||
owner_friend_ids = get_owner_friend_ids()
|
||||
return ctx.author.id in owner_friend_ids or await ctx.bot.is_owner(ctx.author)
|
||||
return commands.check(predicate)
|
||||
|
||||
Reference in New Issue
Block a user