Added add_attraction command

master
Joey Hines 2019-05-13 09:49:47 -05:00
parent 83aa17f375
commit 93fba48b15
1 changed files with 21 additions and 0 deletions

View File

@ -60,6 +60,27 @@ class GeoffreyCommands(commands.Cog):
self.base_url = bot.base_url self.base_url = bot.base_url
self.api_token = bot.api_token self.api_token = bot.api_token
@commands.command(pass_context=True)
async def add_attraction(self, ctx, x_pos: int, z_pos: int, *args):
"""
{}add_attraction <X Coordinate> <Z Coordinate> <Name>
The Name parameter is optional if this is your first attraction
"""
errors = {
"LocationLookUpError": "you have more than one location. Please specify a name."
}
name = get_name(args)
attraction = await run_command(ctx, self.base_url, self.api_token, "POST", "add_attraction", x_pos=x_pos,
z_pos=z_pos, name=name, discord_uuid=ctx.message.author.id, errors=errors)
await ctx.send(
'{}, your attraction has been added to the database: \n{}'.format(ctx.message.author.mention,
formatted_location(attraction)))
@commands.command(pass_context=True) @commands.command(pass_context=True)
async def add_base(self, ctx, x_pos: int, z_pos: int, *args): async def add_base(self, ctx, x_pos: int, z_pos: int, *args):
""" """