Baphomet is the dedicated bot for nulloctet matrix
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.

48 lines
1.9 KiB

  1. /**
  2. * Module for interacting with a Szurubooru instance
  3. */
  4. let { AbstractModule } = require('../abstract');
  5. let { logger } = require('../../logging');
  6. class SzurubooruModule extends AbstractModule {
  7. constructor() {
  8. super(
  9. "Szurubooru",
  10. "Interact with a Szurubooru instance",
  11. "szurubooru"
  12. );
  13. this.helpAndUsage = `Usage:
  14. '!szurubooru <tag> [<tag>...]' display a random post that matches tags
  15. '!szurubooru config' prints config information for the room
  16. '!szurubooru config upload' toggles uploading images from room messages
  17. '!szurubooru iqdb' get an IQDB link for the last displayed post
  18. '!szurubooru need [<max tag count (5)>]' show a random post that needs additional tags
  19. '!szurubooru post <post_id>' retrieve a post and publish the image to the room
  20. '!szurubooru random [<tag>...]' display a random image from szurubooru that matches tags if preset
  21. '!szurubooru random update' update the random counts
  22. '!szurubooru recent [<days> (1)]' display a recent random image within the last <days>
  23. '!szurubooru related' display related posts to the last displayed post
  24. '!szurubooru tag <tag> [<tag>...]' add tags to the last displayed post
  25. '!szurubooru tag clone <post_id>' clone tags from <post_id> to the last displayed post
  26. '!szurubooru tag remove <tag> [<tag>...]' remove tags from the last displayed post
  27. '!szurubooru tags' list of all tags by popularity
  28. '!szurubooru tags <tag_stub> [<tag_stub>...]' list tags similar to each <tag_stub>
  29. '!szurubooru upload <url>' upload a remote file to szurubooru`;
  30. this.needConfig = true;
  31. this.defaultCommand = 'help';
  32. }
  33. getConfigSensitiveFields() {
  34. return ["token"];
  35. }
  36. /* Commands
  37. * All methods starting with cmd_ will be parsed at initialization to expose those methods as commdands to the user
  38. */
  39. cmd_random(event, ...args) {
  40. }
  41. }
  42. exports.module = new SzurubooruModule();