A Mastodon bot for pinging
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Noëlle b14c033b71
Add message to readme
před 2 roky
.gitignore Initial commit před 2 roky
LICENSE Initial commit před 2 roky
README.md Add message to readme před 2 roky
pingbot.py Update readme, make needed changes před 2 roky
sample-config.cfg Update readme, make needed changes před 2 roky

README.md

Pingbot

Pingbot monitors a Mastodon account, and will ping one or more other accounts any time that account gets a notification. This is useful for monitoring an admin account that may not be logged in all the time, or for checking in on an old account after you’ve made a new one.

Setup

You cannot monitor an account you can’t log into. This is deliberate and will not be changed.

On the account you want to monitor, open Preferences, then Development, and click the New Application button at the upper right.

You’ll need to give your application a name; this can be pretty much anything you want. Leave “Application website” blank, and leave “Redirect URI” alone.

You can leave Scopes alone; all Pingbot does is check your notifications and send you DMs. However, if you want to limit Pingbot’s access for security, it must have read:notifications and write:statuses in order to do its job.

Click the Submit button at the bottom, and you’ll see “Application successfully created”, as well as your new application in the list below. Click the name you chose (it should be blue), and this will bring up a screen that shows you the client key, client secret, and access token.

In Pingbot’s directory, copy sample-config.cfg to config.cfg, and then open it for editing. You’ll need a separate header in the config file, enclosed by [brackets], for each bot you want to run in the same directory. The sample configuration file includes a [pingbot] header for you, as well as a [DEFAULT] header for settings that apply to every bot in the directory. You should place most of your information under the [pingbot] header; the configuration file includes instructions on how to do this. (Note that what the Mastodon web interface calls a “Client key”, the config file calls a client_id.)

In the configuration file, every username you include should not have an @ before it (e.g. noelle@elekk.xyz, not @noelle@elekk.xyz).

Once all your information is in the configuration file, save it, and then run

ananas config.cfg

in a terminal window and your bot will start up and begin listening! In Linux, you can run your bot in the background by adding an & to the end:

ananas config.cfg &

Or you can use a window manager like tmux or screen, which will let you keep the bot running on a server without you havnig to be logged in.

Making configuration changes

If you want to change Pingbot’s settings, you’ll need to stop and restart the bot. Make sure you stop the bot before you make changes; Pingbot saves its configuration when it shuts down, and might overwrite your changes.