Ensure settings exist in battle
This commit is contained in:
parent
943b46d4e9
commit
e13b74ce38
|
@ -242,17 +242,16 @@ class Interaction:
|
||||||
"SELECT custom_battles, include_default_battles FROM guilds WHERE id = $1",
|
"SELECT custom_battles, include_default_battles FROM guilds WHERE id = $1",
|
||||||
ctx.guild.id
|
ctx.guild.id
|
||||||
)
|
)
|
||||||
custom_msgs = settings["custom_battles"]
|
msgs = battle_outcomes
|
||||||
default_on = settings["include_default_battles"]
|
if settings:
|
||||||
# if they exist, then we want to see if we want to use default as well
|
custom_msgs = settings["custom_battles"]
|
||||||
if custom_msgs:
|
default_on = settings["include_default_battles"]
|
||||||
if default_on or default_on is None:
|
# if they exist, then we want to see if we want to use default as well
|
||||||
msgs = battle_outcomes + custom_msgs
|
if custom_msgs:
|
||||||
else:
|
if default_on or default_on is None:
|
||||||
msgs = custom_msgs
|
msgs += custom_msgs
|
||||||
# Otherwise we simply just want to use the default, no matter what the default setting is
|
else:
|
||||||
else:
|
msgs = custom_msgs
|
||||||
msgs = battle_outcomes
|
|
||||||
|
|
||||||
fmt = random.SystemRandom().choice(msgs)
|
fmt = random.SystemRandom().choice(msgs)
|
||||||
# Due to our previous checks, the ID should only be in the dictionary once, in the current battle we're checking
|
# Due to our previous checks, the ID should only be in the dictionary once, in the current battle we're checking
|
||||||
|
|
Loading…
Reference in a new issue