mirror of
https://gitlab.com/MisterBiggs/multi-bot-tutorial.git
synced 2025-06-15 22:56:45 +00:00
Updated to use new roadster function
This commit is contained in:
parent
684fff6f8d
commit
56b35129b5
@ -1,5 +1,5 @@
|
||||
import discord
|
||||
from functions import nextLaunch
|
||||
from functions import nextLaunch, roadster
|
||||
|
||||
client = discord.Client()
|
||||
|
||||
@ -27,8 +27,31 @@ async def on_message(message):
|
||||
embed.add_field(
|
||||
name="Countdown to Launch", value=launch["countdown"], inline=False
|
||||
)
|
||||
await message.channel.say(embed=embed)
|
||||
await message.channel.send(embed=embed)
|
||||
|
||||
elif message.content.startswith("/roadster"):
|
||||
roadster_data = roadster()
|
||||
|
||||
embed = discord.Embed(
|
||||
title=roadster_data["name"],
|
||||
url=roadster_data["wikipedia"],
|
||||
description=f"Launched {roadster_data['days_passed']} ago.",
|
||||
color=0xFF0000,
|
||||
)
|
||||
|
||||
embed.add_field(
|
||||
name="Distance From Earth",
|
||||
value=f"{round(roadster_data['earth_distance_km'])} (km)",
|
||||
inline=True,
|
||||
)
|
||||
embed.add_field(
|
||||
name="Distance From Mars",
|
||||
value=f"{round(roadster_data['mars_distance_km'])} (km)",
|
||||
inline=True,
|
||||
)
|
||||
embed.set_footer(text="Thanks Elon <3")
|
||||
await message.channel.send(embed=embed)
|
||||
|
||||
|
||||
client.run("your token here")
|
||||
client.run("TOKEN")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user