from bot import MyBot import os from os.path import join, dirname from dotenv import load_dotenv from cogs.utils.helpcommand import PaginatedHelpCommand dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) bot = MyBot('/', help_command=PaginatedHelpCommand()) extensions = [ 'cogs.manager', 'cogs.webhook', 'cogs.admin', 'cogs.meta', 'cogs.subscription', ] for extension in extensions: bot.load_extension(extension) bot.run(os.environ.get('TOKEN'))
from bot import MyBot import os from os.path import join, dirname from dotenv import load_dotenv load_dotenv(verbose=True) dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) bot = MyBot() extensions = ['cogs.operation', 'cogs.usually', 'cogs.watch', 'cogs.join_channel'] # extensions = ['cogs.jinrou'] for extension in extensions: bot.load_extension(extension) bot.run(os.environ.get("TOKEN"))
from config import Config from bot import MyBot from cogs import Greetings COGS_LIST = [Greetings] if __name__ == '__main__': bot = MyBot(command_prefix='.') for cog in COGS_LIST: bot.add_cog(cog(bot)) bot.run(Config.token)
from bot import MyBot from dotenv import load_dotenv import os load_dotenv() bot = MyBot() extensions = ['cogs.wallet', 'cogs.give'] for extension in extensions: bot.load_extension(extension) bot.run(os.environ["BOT_TOKEN"])