mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 14:27:27 +00:00
Merge branch 'master' into dev
This commit is contained in:
commit
1e61dd7dff
2 changed files with 54 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Modumind
|
# Modufur
|
||||||
Discord booru bot with a side of management and tasking
|
Discord booru bot with a side of management and tasking.
|
||||||
|
|
||||||
Credits:
|
Credits:
|
||||||
Rapptz/discord.py
|
Rapptz/discord.py
|
||||||
|
|
|
@ -1,52 +1,52 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
import traceback
|
import traceback
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
|
||||||
import discord as d
|
import discord as d
|
||||||
from discord import errors as err
|
from discord import errors as err
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from discord.ext.commands import errors as errext
|
from discord.ext.commands import errors as errext
|
||||||
|
|
||||||
from utils import utils as u
|
from utils import utils as u
|
||||||
|
|
||||||
owner_id = u.config['owner_id']
|
owner_id = u.config['owner_id']
|
||||||
ready = False
|
ready = False
|
||||||
|
|
||||||
|
|
||||||
def is_owner():
|
def is_owner():
|
||||||
async def predicate(ctx):
|
async def predicate(ctx):
|
||||||
return ctx.message.author.id == owner_id
|
return ctx.message.author.id == owner_id
|
||||||
return commands.check(predicate)
|
return commands.check(predicate)
|
||||||
|
|
||||||
|
|
||||||
def is_admin():
|
def is_admin():
|
||||||
def predicate(ctx):
|
def predicate(ctx):
|
||||||
return ctx.message.author.guild_permissions.administrator
|
return ctx.message.author.guild_permissions.administrator
|
||||||
return commands.check(predicate)
|
return commands.check(predicate)
|
||||||
|
|
||||||
|
|
||||||
def is_mod():
|
def is_mod():
|
||||||
def predicate(ctx):
|
def predicate(ctx):
|
||||||
return ctx.message.author.guild_permissions.ban_members
|
return ctx.message.author.guild_permissions.ban_members
|
||||||
return commands.check(predicate)
|
return commands.check(predicate)
|
||||||
|
|
||||||
|
|
||||||
def owner(ctx):
|
def owner(ctx):
|
||||||
return ctx.message.author.id == owner_id
|
return ctx.message.author.id == owner_id
|
||||||
|
|
||||||
|
|
||||||
def admin(ctx):
|
def admin(ctx):
|
||||||
return ctx.message.author.guild_permissions.administrator
|
return ctx.message.author.guild_permissions.administrator
|
||||||
|
|
||||||
|
|
||||||
def mod(ctx):
|
def mod(ctx):
|
||||||
return ctx.message.author.guild_permissions.ban_members
|
return ctx.message.author.guild_permissions.ban_members
|
||||||
|
|
||||||
|
|
||||||
def is_nsfw():
|
def is_nsfw():
|
||||||
def predicate(ctx):
|
def predicate(ctx):
|
||||||
if isinstance(ctx.message.channel, d.TextChannel):
|
if isinstance(ctx.message.channel, d.TextChannel):
|
||||||
return ctx.message.channel.is_nsfw()
|
return ctx.message.channel.is_nsfw()
|
||||||
return True
|
return True
|
||||||
return commands.check(predicate)
|
return commands.check(predicate)
|
||||||
|
|
Loading…
Reference in a new issue