Add random note text length generator to GenerateUser (#2)

Self-explanatory, I forgot to add RNG for note text length in `src.Generate.GenerateUser.GenerateUser.autorun()`

Reviewed-on: https://codeberg.org/vlw/misskey-microblogger/pulls/2
Co-authored-by: Victor Westerlund <victor.vesterlund@gmail.com>
Co-committed-by: Victor Westerlund <victor.vesterlund@gmail.com>
This commit is contained in:
Victor Westerlund 2024-11-14 13:26:21 +00:00 committed by Victor Westerlund
parent 3dc25ee994
commit ca6506eaad

View file

@ -17,6 +17,10 @@ USER_TEMPLATE_FILE = Path.cwd() / "data" / "users_template.json"
CONFIG_POST_MIN_COOLDOWN = 300 # 10 minutes CONFIG_POST_MIN_COOLDOWN = 300 # 10 minutes
CONFIG_POST_MAX_COOLDOWN = 259200 # 48 hours CONFIG_POST_MAX_COOLDOWN = 259200 # 48 hours
CONFIG_TEXT_LENGTH_AVERAGE_MIN = 7
CONFIG_TEXT_LENGTH_AVERAGE_MAX = 30
CONFIG_TEXT_LENGTH_AVERAGE_FLUX = 10
# Available preferred reactions # Available preferred reactions
REACTIONS = [ REACTIONS = [
"", "",
@ -91,6 +95,10 @@ class GenerateUser():
for relationship in RelationshipType: for relationship in RelationshipType:
self.config["actions"]["reacts"]["prefrerred_reaction"][relationship.value] = random.choice(REACTIONS) self.config["actions"]["reacts"]["prefrerred_reaction"][relationship.value] = random.choice(REACTIONS)
# Generate random note text length averages
self.config["note"]["text_length"]["flux"] = random.randint(0, CONFIG_TEXT_LENGTH_AVERAGE_FLUX)
self.config["note"]["text_length"]["average"] = random.randint(CONFIG_TEXT_LENGTH_AVERAGE_MIN, CONFIG_TEXT_LENGTH_AVERAGE_MAX)
# Set random personality tone # Set random personality tone
for x in NoteTones: for x in NoteTones:
self.config["personality"]["tone"]["probability"][x.value] = random.randint(0, 100) self.config["personality"]["tone"]["probability"][x.value] = random.randint(0, 100)