From 2b7a9cc036e2ea7bb614eaee57de43b90a6344fd Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Mon, 21 May 2018 10:59:35 -0500 Subject: [PATCH] Initial Commit --- MCInfoBot.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 MCInfoBot.py diff --git a/MCInfoBot.py b/MCInfoBot.py new file mode 100644 index 0000000..dba1d9e --- /dev/null +++ b/MCInfoBot.py @@ -0,0 +1,39 @@ +import discord +from discord.ext import commands + +TOKEN = 'MTgzMDMyMDE5MTk2ODM3ODg4.DeRsbQ.UmFJ_7bjmIuIp8jIk6AkUnQ49a0' + +command_prefix = '?' +description = '''Geoffrey is an inside joke none of you will understand, at +least he knows where your bases are.''' + +bot = commands.Bot(command_prefix=command_prefix , description=description) + +playing = 'Waiting for you to type ''?''' + +@bot.event +async def on_ready(): + print('GeoffreyBot') + print('Username: ' + bot.user.name) + print('ID: ' + bot.user.id) + +@bot.command() +async def test(): + '''Check if the bot is alive''' + await bot.say('I\'m here you ding dong') + +@bot.command(pass_context=True) +async def addBase(ctx, * args): + if (len(args) > 0) : + try: + name = args[0] + x = int(args[1]) + z = int(args[2]) + await bot.say('{}, your base named {} located at (x={},z={}) has been added to the database.'.format(ctx.message.author.mention, name, x, z)) + except ValueError: + await bot.say('Invalid syntax, try again (?addbase [name] [x coord] [z coord])') + + else : + await bot.say('Allows you to add your base location to the database. Syntax: ?addbase [Base Name] [X Cordinate] [Z Cordinate]') + +bot.run(TOKEN) \ No newline at end of file