From bbacc30c3d195a3f54d2ac11875df405ef467ee5 Mon Sep 17 00:00:00 2001 From: nsde Date: Fri, 21 Jul 2023 23:49:54 +0200 Subject: [PATCH] Simple boilerplate --- .vscode/settings.json | 14 ++++++++++++++ cord/bot.py | 26 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 cord/bot.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..432f1b7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + "**/__pycache__": true, + "**/.vscode": true, + "**/*.map": true + }, + "hide-files.files": [] +} \ No newline at end of file diff --git a/cord/bot.py b/cord/bot.py new file mode 100644 index 0000000..36d120e --- /dev/null +++ b/cord/bot.py @@ -0,0 +1,26 @@ +# This example requires the 'members' and 'message_content' privileged intents to function. + +import os +import discord + +from dotenv import load_dotenv +from discord.ext import commands + +load_dotenv() + +intents = discord.Intents.default() +intents.members = True +intents.message_content = True + +bot = commands.Bot(command_prefix='?', intents=intents) + +@bot.event +async def on_ready(): + print(f'Online as {bot.user} (ID: {bot.user.id})') + await bot.change_presence(activity=discord.Game(name='with fire')) + +@bot.event +async def on_message(message): + await bot.process_commands(message) + +bot.run(os.getenv('DISCORD_TOKEN'))