create framework of bot core
This commit is contained in:
32
src/bot_core.py
Normal file
32
src/bot_core.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# pylint: disable=consider-using-with, no-member
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import discord
|
||||||
|
from discord.ext import commands
|
||||||
|
|
||||||
|
CONTRASTELLAR = 181187505448681472
|
||||||
|
|
||||||
|
intents = discord.Intents.default()
|
||||||
|
intents.message_content = True
|
||||||
|
intents.guild_messages = True
|
||||||
|
intents.presences = False
|
||||||
|
|
||||||
|
client = commands.Bot(command_prefix='!', intents=intents)
|
||||||
|
|
||||||
|
|
||||||
|
parser: argparse.ArgumentParser = argparse.ArgumentParser(prog='very bad core',
|
||||||
|
description='very bad bot core')
|
||||||
|
parser.add_argument('token')
|
||||||
|
|
||||||
|
# --- commands below here
|
||||||
|
|
||||||
|
@client.event
|
||||||
|
async def on_ready():
|
||||||
|
print(f'{client.user} has connected.')
|
||||||
|
# --- end commands
|
||||||
|
|
||||||
|
args: argparse.Namespace = parser.parse_args()
|
||||||
|
|
||||||
|
TOKEN: str = open(args.token, encoding='utf-8').read()
|
||||||
|
client.run(TOKEN)
|
||||||
|
|
||||||
Reference in New Issue
Block a user