From 04a0922c17f19e531725527f3077ed2d672f2e92 Mon Sep 17 00:00:00 2001 From: mloe Date: Wed, 19 Oct 2022 23:57:15 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 74 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/bot.py b/bot.py index 7410b97..95824c3 100644 --- a/bot.py +++ b/bot.py @@ -1,36 +1,40 @@ -from genericpath import exists -import subprocess -import json -import discord -from discord.ext import commands - - -with open('config.json', 'r') as f: - data = json.load(f) - -if exists('config.local.json'): - with open('config.local.json') as f: - data = json.load(f) - -intents = discord.Intents.default() -intents.message_content = True - -description = '''Bot to end all bots''' - -bot = commands.Bot(command_prefix='?', description=description, intents=intents) - -@bot.event -async def on_ready(): - print(f'Logged in as {bot.user}') - print('------') - -@bot.command() -async def add(ctx, left: int, right: int): - await ctx.send(left + right) - -@bot.command() -async def update(ctx): - subprocess.Popen('./update.sh') - print(f'Updating, see you on the other side') - +from genericpath import exists +import subprocess +import json +import discord +from discord.ext import commands + + +with open('config.json', 'r') as f: + data = json.load(f) + +if exists('config.local.json'): + with open('config.local.json') as f: + data = json.load(f) + +intents = discord.Intents.default() +intents.message_content = True + +description = '''Bot to end all bots''' + +bot = commands.Bot(command_prefix='?', description=description, intents=intents) + +@bot.event +async def on_ready(): + print(f'Logged in as {bot.user}') + print('------') + +@bot.command() +async def add(ctx, left: int, right: int): + await ctx.send(left + right) + +@bot.command() +async def sub(ctx, left: int, right: int): + await ctx.send(left - right) + +@bot.command() +async def update(ctx): + subprocess.Popen('./update.sh') + print(f'Updating, see you on the other side') + bot.run(data['token']) \ No newline at end of file