Esempio n. 1
0
 def __init__(self, bot):
     global gcmds
     self.bot = bot
     self.tasks = []
     gcmds = GlobalCMDS(self.bot)
     self.bot.loop.create_task(self.init_disboard())
     self.bot.loop.create_task(self.check_unsent_reminder())
Esempio n. 2
0
 def __init__(self, bot: commands.AutoShardedBot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
     self.bot.loop.create_task(self.init_logging())
     self.guild_dispatch = logdispatcher.GuildDispatcher(self.bot)
     self.member_dispatch = logdispatcher.MemberDispatcher(self.bot)
Esempio n. 3
0
 def __init__(self, bot: commands.AutoShardedBot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
     self.bot.loop.create_task(self.init_todo())
Esempio n. 4
0
import asyncio
import base64
from datetime import datetime

import discord
from discord.ext import commands
from utils import EmbedPaginator, GlobalCMDS, SubcommandPaginator, customerrors

gcmds = GlobalCMDS()


class Todo(commands.Cog):
    def __init__(self, bot: commands.AutoShardedBot):
        global gcmds
        self.bot = bot
        gcmds = GlobalCMDS(self.bot)
        self.bot.loop.create_task(self.init_todo())

    async def init_todo(self):
        await self.bot.wait_until_ready()
        async with self.bot.db.acquire() as con:
            await con.execute("CREATE TABLE IF NOT EXISTS todos(id SERIAL, message_content text, status text, timestamp NUMERIC, author_id bigint)")

    async def todo_help(self, ctx):
        pfx = f"{await gcmds.prefix(ctx)}todo"
        description = (f"{ctx.author.mention}, the base command is `{pfx}` *alias = `td` `todos`*. The `todo` commands "
                       "serve as an alternative to `reminders`, which are scheduled to fire at a specific point in time,"
                       " or on a defined interval. If you just want an organised list of tasks to complete, or are not "
                       "sure when you want to complete that task, then use `todo`\n\nHere are all the subcommands for `todo`")
        tset = (f"**Usage:** `{pfx} create [item]`",
                "**Returns:** An embed that confirms your todo was successfully created, or added to the current todo list",
Esempio n. 5
0
 def __init__(self, bot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
     self.bot.loop.create_task(self.init_blacklist())
Esempio n. 6
0
 def __init__(self, bot: commands.AutoShardedBot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
Esempio n. 7
0
 def __init__(self, bot: commands.AutoShardedBot):
     super().__init__()
     self.bot = bot
     self.min_level = LogLevel.BASIC
     self.gcmds = GlobalCMDS(self.bot)
Esempio n. 8
0
 def __init__(self, bot: commands.AutoShardedBot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
     self.bot.loop.create_task(self.init_blacklist())
     self.bot.loop.create_task(self.init_balance())
Esempio n. 9
0
 def __init__(self, bot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
Esempio n. 10
0
 def __init__(self, bot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
     self.bot.loop.create_task(self.init_welcomer())
Esempio n. 11
0
import asyncio
import mimetypes
import random
import re

import aiohttp
import discord
from discord.ext import commands
from num2words import num2words
from utils import GlobalCMDS, SubcommandPaginator, customerrors

gcmds = GlobalCMDS()
timeout = 120
channel_tag_rx = re.compile(r'<#[\d]{18}>')
channel_id_rx = re.compile(r'[\d]{18}')
api_key = gcmds.env_check("TENOR_API")


class Welcome(commands.Cog):
    def __init__(self, bot):
        global gcmds
        self.bot = bot
        gcmds = GlobalCMDS(self.bot)
        self.bot.loop.create_task(self.init_welcomer())

    @commands.Cog.listener()
    async def on_member_join(self, member: discord.Member):
        await self.send_welcomer(member)

    @commands.Cog.listener()
    async def on_member_remove(self, member: discord.Member):
Esempio n. 12
0
 def __init__(self, bot):
     global gcmds
     self.bot = bot
     gcmds = GlobalCMDS(self.bot)
     self.tasks = []
     self.bot.loop.create_task(self.init_reminders())
Esempio n. 13
0
 def __init__(self, bot: commands.AutoShardedBot):
     global gcmds, _bot
     self.bot = bot
     _bot = self.bot
     gcmds = GlobalCMDS(self.bot)
     self.bot.loop.create_task(self.init_serverlink())