removing /trackdays because trackpinata exists
This commit is contained in:
parent
1704fdbed1
commit
12ebef8e01
@ -128,49 +128,6 @@ class ActualUtils(commands.Cog):
|
||||
except Exception:
|
||||
return await ctx.send_followup("Sorry, I'm unable to answer that")
|
||||
|
||||
@commands.has_role("Track day gamers")
|
||||
@commands.slash_command(
|
||||
guild_ids=core_utils.my_guilds,
|
||||
name="trackdays",
|
||||
description="Query motorsportsreg.com for a list of trackdays going on at Buttonwillow and Thunderhill",
|
||||
)
|
||||
@option(
|
||||
"track",
|
||||
description="Choose a track to see the trackdays at, or leave blank for all",
|
||||
choices=["Buttonwillow", "Thunderhill", "Both"],
|
||||
default="Both",
|
||||
)
|
||||
async def trackdays(self, ctx: commands.Context, track: str):
|
||||
import trackdays
|
||||
|
||||
shid = await trackdays.get_msreg(track=track)
|
||||
for track, events in shid.items():
|
||||
embed = discord.Embed(
|
||||
description=":checkered_flag: **Upcoming events at %s**:checkered_flag: "
|
||||
% track,
|
||||
color=0x428BCA,
|
||||
type="rich",
|
||||
)
|
||||
for track_day in events:
|
||||
embed.add_field(
|
||||
name="-------------\n**Organizer**",
|
||||
value=track_day["event_organizer"],
|
||||
inline=False,
|
||||
)
|
||||
embed.add_field(
|
||||
name="**Event Name**",
|
||||
value=track_day["event_name"],
|
||||
inline=False,
|
||||
)
|
||||
embed.add_field(
|
||||
name="Date", value=track_day["event_date"], inline=False
|
||||
)
|
||||
embed.add_field(
|
||||
name="Event URL", value=track_day["event_url"], inline=False
|
||||
)
|
||||
await ctx.defer()
|
||||
await ctx.send_followup(embed=embed)
|
||||
|
||||
@commands.slash_command(
|
||||
guld_ids=None,
|
||||
name="stock",
|
||||
|
@ -156,6 +156,8 @@ async def rsi_find(player):
|
||||
org_name = (
|
||||
org_soup.find("div", class_="inner").findNext("h1").text.split("/")[0]
|
||||
)
|
||||
|
||||
print(org_name)
|
||||
org_abbreviation = (
|
||||
org_soup.find("div", class_="inner").findNext("span", class_="symbol").text
|
||||
)
|
||||
|
@ -76,30 +76,3 @@ async def get_msreg(track):
|
||||
pass
|
||||
|
||||
return events
|
||||
|
||||
|
||||
def get_corsa_club():
|
||||
base_url = "https://corsa.club"
|
||||
events = {}
|
||||
products_blob = requests.get(base_url + "/products.json").json()["products"]
|
||||
for event in products_blob:
|
||||
# Filter out hoodies and what not, only care about track days that list run-groups as the options
|
||||
if any("Intermediate" in s for s in event["options"][0]["values"]):
|
||||
event_object = {
|
||||
"event_name": event["title"],
|
||||
"event_url": base_url + "/products/" + event["handle"],
|
||||
"event_date": event["title"].split()[-1],
|
||||
}
|
||||
track = " ".join(event["title"].split()[0:-1])
|
||||
try:
|
||||
if track not in events:
|
||||
events[track] = []
|
||||
events[track].append(event_object)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
return events
|
||||
|
||||
|
||||
# if __name__ == '__main__':
|
||||
# get_corsa_club()
|
||||
|
Loading…
x
Reference in New Issue
Block a user