simplify gen_post() a tiny bit

This commit is contained in:
Kay Faraday 2022-01-25 05:33:39 +00:00
parent bac5b974f4
commit 0d779e8e58
1 changed files with 4 additions and 5 deletions

View File

@ -19,11 +19,10 @@ def load_static():
def gen_post(messages, labels): def gen_post(messages, labels):
message = random.choice(messages) message = random.choice(messages)
label = random.choice(labels) label = random.choice(labels)
if message.startswith('{}'): message = message.format(label)
# believe me, there isn't already a string method that does this. # believe me, there isn't already a string method that does this.
# not even .capitalize(). # not even .capitalize().
label = label[0].upper() + label[1:] return message[0].upper() + message[1:]
return message.format(label)
async def main(): async def main():
config = load_config() config = load_config()