simple.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import random
  2. from command_system import as_plugin
  3. @as_plugin
  4. def isadmin(message):
  5. return message.from_admin
  6. @as_plugin
  7. def debug(message):
  8. return message
  9. @as_plugin
  10. def echo(message):
  11. return "'%s' - %s" % (message.raw_args or "", message.name)
  12. @as_plugin
  13. def greet():
  14. return random.choice(("Hi!", "Hello!", "안녕하세요", "こんにちは", "你好", "👋"))
  15. @as_plugin
  16. def console(message):
  17. argstr = message.raw_args
  18. opts = [
  19. "NEVER GIVE UP",
  20. "I believe in you!",
  21. "You're doing your best, it's okay!"
  22. ]
  23. if argstr is not None:
  24. opts.append("It'll be okay, {}! Keep trying!".format(argstr))
  25. return random.choice(opts)
  26. @as_plugin
  27. def choice(message):
  28. opts = list(message.args())
  29. chosen = random.choice(opts)
  30. return f"Randomly chose {chosen} from {len(opts)} options"
  31. @as_plugin
  32. def inquire(message):
  33. opts = "Yes", "No", "Maybe", "Perhaps", "I guess", "Probably shouldn't", "rand"
  34. chosen = random.choice(opts)
  35. if chosen == "rand":
  36. chosen = string(random.randrange(10))
  37. return f"{chosen}"