mastoes-bots/insultabot_hourly.py

16 lines
672 B
Python
Raw Normal View History

2024-12-03 23:33:00 +00:00
from common import get_api, get_gender, list_read
from random import choice
from insultabot import get_insulto_inclusivo
bot_name = 'insultabot'
api = get_api('masto.es', bot_name)
followers = api.account_followers(api.me().id, limit=80)
followers = api.fetch_remaining(followers)
insultos = list_read(bot_name + "_insultos")
choosen_insulto = choice(insultos)
choosen_user = choice(followers)
gender = get_gender(choosen_user)
insulto = get_insulto_inclusivo(choosen_insulto, gender).capitalize()
api.status_post("@" + choosen_user.acct + " ¡" + insulto + "!\n\nInsulto gratuito periódico patrocinado por Insultabot para sus seguidores.", visibility="unlisted" )