Esempio n. 1
0
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.api = challonge_api.ChallongeAPI(self.client)
Esempio n. 2
0
import discord
import time
import asyncio
import math

from humanfriendly import format_timespan as timeez

from constants import ADMIN_PRIVILEGE_ROLES
from utils.updation import match_score, round_score
from utils import updation, cf_api
from data import dbconn


db = dbconn.DbConn()
cf = cf_api.CodeforcesAPI()


def has_admin_privilege(ctx):
    if ctx.channel.permissions_for(ctx.author).manage_guild:
        return True
    for role in ADMIN_PRIVILEGE_ROLES:
        if role.lower() in [x.name.lower() for x in ctx.author.roles]:
            return True
    return False


async def send_message(ctx, message):
    await ctx.send(embed=discord.Embed(description=message, color=discord.Color.gold()))


async def get_time_response(client, ctx, message, time, author, range_):
Esempio n. 3
0
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.client.remove_command("help")
Esempio n. 4
0
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.cf = cf_api.CodeforcesAPI()
Esempio n. 5
0
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.uptime = int(time.time())