This code publish information of the Mastodon instance where the bot has its account, if requested, then reply following information: Registered users, Active users (MAU), LocalPosts, Instance's peers, Mastodon's version and Registration Opened/Closed
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
info/info.py

35 lines
601 B

from mastobot import Mastobot
# main
if __name__ == '__main__':
bot = Mastobot()
notifications = bot.mastodon.notifications()
for notif in notifications:
if notif.type != 'mention':
print(f"Dismissing notification id {notif.id}")
bot.mastodon.notifications_dismiss(notif.id)
else:
mention = bot.get_data(notif)
if mention.reply:
bot.post(mention)
else:
print(f"Dismissing notification id {notif.id}")
bot.mastodon.notifications_dismiss(notif.id)