Beispiel #1
0
from cogs.trivia import Trivia
from cogs.admin import Admin

intents = nextcord.Intents()
intents.members = True  # Join/Leave messages
intents.guild_messages = True  # Trivia
intents.bans = True  # Ban messages
intents.guilds = True  # Docs says so
intents.guild_reactions = True  # For roles

db = sqlite3.connect('data/malcolm.db')
cur = db.cursor()

logging.basicConfig(level=logging.WARN)
bot = Malcolm(command_prefix=',', intents=intents, configpath=sys.argv[1])


@bot.event
async def on_ready():
    logging.info('Malcolm-next has started')


bot.add_cog(JoinLeave(bot))
bot.add_cog(Trivia(bot, db, cur))
bot.add_cog(Utils(bot))
bot.add_cog(Roles(bot, db, cur))
bot.add_cog(Admin(bot))
bot.add_cog(Fun(bot))

bot.run()
Beispiel #2
0
dirname = os.path.dirname(__file__)

cloud_config = {
    'secure_connect_bundle':
    os.path.join(dirname, '../secure-connect-giraffe-time.zip')
}
auth_provider = PlainTextAuthProvider(os.getenv('DB_USERNAME'),
                                      os.getenv('DB_PASSWORD'))
cluster = Cluster(cloud=cloud_config, auth_provider=auth_provider)
session = cluster.connect()

from discord.ext import commands
from cogs.fun import Fun
from cogs.utils import Utils
from cogs.reminder import Reminder
from cogs.roles import Roles

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

bot = commands.Bot(command_prefix='/', intents=intent)

# Add cogs here
bot.add_cog(Fun(bot, session))
bot.add_cog(Utils(bot, session))
bot.add_cog(Reminder(bot, session))
bot.add_cog(Roles(bot, session))

bot.run(os.getenv('DISCORD_TOKEN'))