A Mastodon bot for pinging
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.

README.md 2.6KB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Pingbot
  2. Pingbot monitors a Mastodon account, and will ping one or more other accounts any time
  3. that account gets a notification. This is useful for monitoring an admin account that
  4. may not be logged in all the time, or for checking in on an old account after you've
  5. made a new one.
  6. ## Setup
  7. **You cannot monitor an account you can't log into. This is deliberate and will not be changed.**
  8. **On the account you want to monitor**, open Preferences, then Development, and click
  9. the New Application button at the upper right.
  10. You'll need to give your application a name; this can be pretty much anything you want.
  11. Leave "Application website" blank, and leave "Redirect URI" alone.
  12. You can leave Scopes alone; all Pingbot does is check your notifications and send you
  13. DMs. However, if you want to limit Pingbot's access for security, it **must** have
  14. `read:notifications` and `write:statuses` in order to do its job.
  15. Click the Submit button at the bottom, and you'll see "Application successfully created",
  16. as well as your new application in the list below. Click the name you chose (it should be
  17. blue), and this will bring up a screen that shows you the **client key**, **client secret**,
  18. and **access token**.
  19. In Pingbot's directory, copy `sample-config.cfg` to `config.cfg`, and then open it for
  20. editing. You'll need a separate header in the config file, enclosed by [brackets], for
  21. each bot you want to run in the same directory. The sample configuration file includes
  22. a [pingbot] header for you, as well as a [DEFAULT] header for settings that apply to
  23. every bot in the directory. You should place most of your information under the
  24. [pingbot] header; the configuration file includes instructions on how to do this.
  25. (Note that what the Mastodon web interface calls a "Client key", the config file
  26. calls a `client_id`.)
  27. In the configuration file, every username you include should *not* have an @ before it
  28. (e.g. `noelle@elekk.xyz`, not `@noelle@elekk.xyz`).
  29. Once all your information is in the configuration file, save it, and then run
  30. `ananas config.cfg`
  31. in a terminal window and your bot will start up and begin listening! In Linux, you can
  32. run your bot in the background by adding an & to the end:
  33. `ananas config.cfg &`
  34. Or you can use a window manager like `tmux` or `screen`, which will let you keep the
  35. bot running on a server without you havnig to be logged in.
  36. ## Making configuration changes
  37. If you want to change Pingbot's settings, you'll need to stop and restart the bot.
  38. Make sure you stop the bot *before* you make changes; Pingbot saves its configuration
  39. when it shuts down, and might overwrite your changes.