示例#1
0
from discord.ext.commands import HelpFormatter
from data import Bot
from utils import permissions, default

config = default.get("config.json")
description = """
Project Management Bot
Made by Johan Tan based on starter bot code by AlexFlipnote
"""


class HelpFormat(HelpFormatter):
    async def format_help_for(self, context, command_or_bot):
        if permissions.can_react(context):
            await context.message.add_reaction(chr(0x2709))

        return await super().format_help_for(context, command_or_bot)


print("Logging in...")
help_attrs = dict(hidden=True)
bot = Bot(command_prefix=config.prefix, prefix=config.prefix, pm_help=True, help_attrs=help_attrs, formatter=HelpFormat())

for file in os.listdir("cogs"):
    if file.endswith(".py"):
        name = file[:-3]
        bot.load_extension(f"cogs.{name}")

bot.run(config.discord_token)
示例#2
0
from discord.ext.commands import HelpFormatter
from data import Bot
from utils import permissions, default
from discord import Webhook, AsyncWebhookAdapter
import aiohttp

config = default.get("config.json")
description = """
A simple starter bot code
Made by AlexFlipnote
"""

print("-w- zzz...")

bot = Bot(command_prefix=os.environ["PREFIX"] + " ",
          prefix=os.environ["PREFIX"] + " ",
          pm_help=True)

for file in os.listdir("cogs"):
    if file.endswith(".py"):
        name = file[:-3]
        try:
            bot.load_extension(f"cogs.{name}")
        except Exception as e:
            print(type(e).__name__)
            print(f"{e}")
            print(f"\nFailed to load {name}")
            pass

bot.run(os.environ["TOKEN"])
示例#3
0
from utils.data import Bot, HelpFormat
from datetime import datetime

client = discord.Client()
intents = discord.Intents.all()

config = default.get("config.json")
description = """
F**k me - Ahiga - AKA Big C**k Hammer- AKA Drunk f*****g sad lowlife - AKA Big chief.
"""

bot = Bot(
    command_prefix=config.prefix,
    prefix=config.prefix,
    command_attrs=dict(hidden=True),
    help_command=HelpFormat(),
    message_list = {}
    intents = intents
)

print("Purging fags...")
#bot = Bot(command_prefix=config.prefix, prefix=config.prefix, command_attrs=dict(hidden=True), help_command=HelpFormat())
bot.startup = datetime.now()

for file in os.listdir("cogs"):
    if file.endswith(".py"):
        name = file[:-3]
        bot.load_extension(f"cogs.{name}")

bot.run(config.token)
示例#4
0
"""


class HelpFormat(HelpFormatter):
    async def format_help_for(self, context, command_or_bot):
        if permissions.can_react(context):
            await context.message.add_reaction(chr(0x2709))

        return await super().format_help_for(context, command_or_bot)


with open("config.json") as f:
    data = json.load(f)
    token = data["token"]
    prefix = data["prefix"]

print("Logging in...")
help_attrs = dict(hidden=True)
bot = Bot(command_prefix=prefix,
          prefix=prefix,
          pm_help=True,
          help_attrs=help_attrs,
          formatter=HelpFormat())

for file in os.listdir("cogs"):
    if file.endswith(".py"):
        name = file[:-3]
        bot.load_extension(f"cogs.{name}")

bot.run(token)