Skip to content

Commit 494523c

Browse files
authored
Keep existing message when modifying factoid if none is specified (#888)
Update factoid to not error when updating a factoid without a message.
1 parent aa44e21 commit 494523c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ __pycache__
77
.pytest_cache
88
.coverage
99
.hypothesis
10+
.idea/

techsupport_bot/commands/factoids.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async def has_given_factoids_role(
145145

146146
class FactoidManager(cogs.MatchCog):
147147
"""
148-
Manages all facttoid features
148+
Manages all factoid features
149149
"""
150150

151151
CRON_REGEX = (
@@ -618,7 +618,9 @@ async def add_factoid(
618618
# Modifies the old entry
619619
factoid = await self.get_raw_factoid_entry(name, str(ctx.guild.id))
620620
factoid.name = name
621-
factoid.message = message
621+
# if no message was supplied, keep the original factoid's message.
622+
if message:
623+
factoid.message = message
622624
factoid.embed_config = embed_config
623625
factoid.alias = alias
624626
await self.modify_factoid_call(factoid=factoid)

0 commit comments

Comments
 (0)