53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
import asyncio
|
|
import discord
|
|
#import Music
|
|
import Shitpost
|
|
import General
|
|
import Cryptocoin
|
|
import Chatbot
|
|
import Points
|
|
import logging
|
|
import dotenv
|
|
import os
|
|
|
|
from discord.ext import commands
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
|
|
dotenv.load_dotenv()
|
|
|
|
async def add_cogs(bot):
|
|
await bot.add_cog(Shitpost.Shitpost(bot))
|
|
await bot.add_cog(General.General(bot))
|
|
await bot.add_cog(Cryptocoin.Cryptocoin(bot))
|
|
await bot.add_cog(Chatbot.Chatbot(bot))
|
|
await bot.add_cog(Points.Points(bot))
|
|
|
|
intents = discord.Intents.default()
|
|
intents.message_content = True
|
|
intents.members = True
|
|
|
|
bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'), description='Stroopwafel. Shitpost bot extraordinaire.', pm_help=True, intents=intents)
|
|
|
|
@bot.event
|
|
async def on_command_error(ctx, error):
|
|
if isinstance(error, commands.BadArgument):
|
|
await ctx.send(f"{ctx.author.mention} Onheus gebruik van het commando. Lees de docs nog eens door:")
|
|
await ctx.send_help(ctx.command)
|
|
return
|
|
if isinstance(error, commands.MissingRequiredArgument):
|
|
await ctx.send(f"{ctx.author.mention} Volgens bij ben je nog iets vergeten toe te voegen aan dit commando. Lees de docs nog eens door:")
|
|
await ctx.send_help(ctx.command)
|
|
return
|
|
if isinstance(error, commands.CommandNotFound):
|
|
await ctx.send(f"{ctx.author.mention} Vermoedelijk bedoelde je iets anders. Typ !help voor alle opties.")
|
|
return
|
|
raise error
|
|
|
|
@bot.event
|
|
async def on_ready():
|
|
await add_cogs(bot)
|
|
print('Logged in as:\n{0} (ID: {0.id})'.format(bot.user))
|
|
|
|
bot.run(os.getenv("STROOP_DISCORD_TOKEN"))
|