locking down trackday function only to trackday gamers

This commit is contained in:
Luke Robles 2021-07-25 18:29:24 -04:00
parent fead0a1e5d
commit 4b6acd28c4
2 changed files with 4 additions and 1 deletions

View File

@ -275,6 +275,9 @@ async def wallpaper(ctx):
@bot.command(name='trackdays') @bot.command(name='trackdays')
async def trackdays(ctx): async def trackdays(ctx):
role = discord.utils.find(lambda r: r.name == 'Track day gamers', ctx.message.guild.roles)
if role not in ctx.message.author.roles:
return await ctx.send('You cant do that')
import trackdays import trackdays
for track, events in trackdays.get_msreg().items(): for track, events in trackdays.get_msreg().items():

View File

@ -16,7 +16,7 @@ def get_msreg():
} }
events = {} events = {}
for org_name, org_id in orgs.items(): for org_name, org_id in orgs.items():
xml_blob = requests.get("%s/%s?exclude_cancelled=true&postalcode=%s&radius=500" % (base_url, org_id, zipcode)).text xml_blob = requests.get("%s/%s?exclude_cancelled=true&postalcode=95035&radius=500" % (base_url, org_id)).text
json_blob = json.loads(json.dumps(xmltodict.parse(xml_blob)['response']['events'])) json_blob = json.loads(json.dumps(xmltodict.parse(xml_blob)['response']['events']))
pp = pprint.PrettyPrinter(indent=4) pp = pprint.PrettyPrinter(indent=4)