function.go 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package common
  2. import "github.com/dop251/goja"
  3. type Function struct {
  4. Rules []string `json:"-"`
  5. Params [][]string `json:"-"`
  6. ImType *Filter `json:"-"`
  7. UserId *Filter `json:"-"`
  8. GroupId *Filter `json:"-"`
  9. FindAll bool `json:"-"`
  10. Admin bool `json:"-"`
  11. Handle func(Sender, func(vm *goja.Runtime)) interface{} `json:"-"`
  12. Cron map[string]string `json:"cron"`
  13. Priority int `json:"-"`
  14. Disable bool `json:"disable"`
  15. Hidden bool `json:"-"`
  16. CronIds []int `json:"-"`
  17. Origin string `json:"-"`
  18. UUID string `json:"id"`
  19. Title string `json:"title"`
  20. Type string `json:"type"` //脚本类型
  21. Suffix string `json:"suffix"` //脚本后缀
  22. Description string `json:"description"`
  23. Public bool `json:"public"`
  24. Icon string `json:"icon"`
  25. Version string `json:"version"`
  26. Author string `json:"author"`
  27. Status int `json:"status"` //0未安装 1可更新 2已安装
  28. Address string `json:"-"`
  29. CreateAt string `json:"create_at"`
  30. Module bool `json:"module"`
  31. // Web bool `json:"web"`
  32. Encrypt bool `json:"encrypt"`
  33. OnStart bool `json:"on_start"`
  34. PluginPublisher
  35. Running bool `json:"running"`
  36. Https []*Http `json:"-"`
  37. Reply *Reply `json:"-"`
  38. Downloads int `json:"downloads"`
  39. HasForm bool `json:"has_form"`
  40. Carry bool `json:"carry"`
  41. Messages interface{} `json:"messages"`
  42. Classes []string `json:"classes"`
  43. Debug bool `json:"debug"`
  44. Path string `json:"-"`
  45. Reload func() `json:"-"`
  46. }
  47. type Filter struct {
  48. BlackMode bool
  49. Items []string
  50. }
  51. type PluginPublisher struct {
  52. Address string `json:"address"`
  53. Organization string `json:"organization"`
  54. Identified bool `json:"identified"`
  55. }
  56. type Http struct { //GET /abc
  57. Path string
  58. Method string
  59. }
  60. type Reply struct { //wx 123 1234
  61. Platform string
  62. BotsID []string
  63. }