-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
32 lines (27 loc) · 1.08 KB
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import config
import discord
from discord.ext import commands
import aetherProp
bot = commands.Bot(command_prefix=".")
@bot.command()
async def propertyInfo(ctx, propertyId, progress):
propId = int(propertyId)
prog = int(progress)
embedObj = discord.Embed(color=0x00ff00)
embedObj.set_footer(text=config.footer)
if prog > 50 or prog < 15:
embedObj.title = 'Error'
embedObj.add_field(name='Message', value='Progress needs to be between 15 and 50!')
elif propId < 16 or propId > 119:
embedObj.title = 'Error'
embedObj.add_field(name='Message', value='Currently property values are between 16-119, try again with one of these numbers!')
else:
data = aetherProp.computeInfo(propId, prog)
rooms = round(data['rooms'])
floors = round(data['floors'])
embedObj.title = 'Property #' + propertyId + ' Info'
embedObj.add_field(name='Floors', value=str(floors))
embedObj.add_field(name='Rooms', value=str(rooms))
await ctx.channel.send(embed=embedObj)
bot.run(config.token)
print("Bot ready...")