-
Notifications
You must be signed in to change notification settings - Fork 9
/
trekduel.py
executable file
·33 lines (30 loc) · 1.18 KB
/
trekduel.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
33
from common import *
from utils.check_channel_access import access_check
@bot.slash_command(
name="trekduel",
description="Return 2 random Trek Characters to fight to the death"
)
@commands.check(access_check)
async def trekduel(ctx:discord.ApplicationContext):
"""
This function is the main entrypoint of the /trekduel command
and will return a prompt with two random characters
"""
f = open(config["commands"]["trekduel"]["data"])
characters = f.read().splitlines()
f.close()
war_intros = ["War! Hoo! Good god y'all!", "War! We're going to war!", "That nonsense is *centuries* behind us!", "There's been no formal declaration, sir.", "Time to pluck a pigeon!"]
pick_1 = random.choice(characters)
pick_2 = random.choice(characters)
chosen_intro = random.choice(war_intros)
while pick_1 == pick_2:
pick_2 = random.choice(characters)
embed = discord.Embed(
title=chosen_intro,
description=f"Who would win in an arbitrary Star Trek duel?!",
color=discord.Color.dark_gold()
)
embed.add_field(name="Red Corner", value=pick_1)
embed.add_field(name=" vs", value="⚔️")
embed.add_field(name="Blue Corner", value=pick_2)
await ctx.respond(embed=embed)