Exemple #1
0
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.api = challonge_api.ChallongeAPI(self.client)
Exemple #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_):
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.client.remove_command("help")
Exemple #4
0
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.cf = cf_api.CodeforcesAPI()
Exemple #5
0
 def __init__(self, client):
     self.client = client
     self.db = dbconn.DbConn()
     self.uptime = int(time.time())