github.com/fumiama/NanoBot@v0.0.0-20231122134259-c22d8183efca/engine_generated.go (about) 1 // Code generated by codegen/engine. DO NOT EDIT. 2 3 package nano 4 5 // OnMessage ... 6 func (e *Engine) OnMessage(rules ...Rule) *Matcher { return e.On("Message", rules...) } 7 8 // OnMessage ... 9 func OnMessage(rules ...Rule) *Matcher { return On("Message", rules...) } 10 11 // OnMessageDelete ... 12 func (e *Engine) OnMessageDelete(rules ...Rule) *Matcher { return e.On("MessageDelete", rules...) } 13 14 // OnMessageDelete ... 15 func OnMessageDelete(rules ...Rule) *Matcher { return On("MessageDelete", rules...) } 16 17 // OnGuildCreate ... 18 func (e *Engine) OnGuildCreate(rules ...Rule) *Matcher { return e.On("GuildCreate", rules...) } 19 20 // OnGuildCreate ... 21 func OnGuildCreate(rules ...Rule) *Matcher { return On("GuildCreate", rules...) } 22 23 // OnGuildUpdate ... 24 func (e *Engine) OnGuildUpdate(rules ...Rule) *Matcher { return e.On("GuildUpdate", rules...) } 25 26 // OnGuildUpdate ... 27 func OnGuildUpdate(rules ...Rule) *Matcher { return On("GuildUpdate", rules...) } 28 29 // OnGuildDelete ... 30 func (e *Engine) OnGuildDelete(rules ...Rule) *Matcher { return e.On("GuildDelete", rules...) } 31 32 // OnGuildDelete ... 33 func OnGuildDelete(rules ...Rule) *Matcher { return On("GuildDelete", rules...) } 34 35 // OnChannelCreate ... 36 func (e *Engine) OnChannelCreate(rules ...Rule) *Matcher { return e.On("ChannelCreate", rules...) } 37 38 // OnChannelCreate ... 39 func OnChannelCreate(rules ...Rule) *Matcher { return On("ChannelCreate", rules...) } 40 41 // OnChannelUpdate ... 42 func (e *Engine) OnChannelUpdate(rules ...Rule) *Matcher { return e.On("ChannelUpdate", rules...) } 43 44 // OnChannelUpdate ... 45 func OnChannelUpdate(rules ...Rule) *Matcher { return On("ChannelUpdate", rules...) } 46 47 // OnChannelDelete ... 48 func (e *Engine) OnChannelDelete(rules ...Rule) *Matcher { return e.On("ChannelDelete", rules...) } 49 50 // OnChannelDelete ... 51 func OnChannelDelete(rules ...Rule) *Matcher { return On("ChannelDelete", rules...) } 52 53 // OnGuildMemberAdd ... 54 func (e *Engine) OnGuildMemberAdd(rules ...Rule) *Matcher { return e.On("GuildMemberAdd", rules...) } 55 56 // OnGuildMemberAdd ... 57 func OnGuildMemberAdd(rules ...Rule) *Matcher { return On("GuildMemberAdd", rules...) } 58 59 // OnGuildMemberUpdate ... 60 func (e *Engine) OnGuildMemberUpdate(rules ...Rule) *Matcher { return e.On("GuildMemberUpdate", rules...) } 61 62 // OnGuildMemberUpdate ... 63 func OnGuildMemberUpdate(rules ...Rule) *Matcher { return On("GuildMemberUpdate", rules...) } 64 65 // OnGuildMemberRemove ... 66 func (e *Engine) OnGuildMemberRemove(rules ...Rule) *Matcher { return e.On("GuildMemberRemove", rules...) } 67 68 // OnGuildMemberRemove ... 69 func OnGuildMemberRemove(rules ...Rule) *Matcher { return On("GuildMemberRemove", rules...) } 70 71 // OnMessageReactionAdd ... 72 func (e *Engine) OnMessageReactionAdd(rules ...Rule) *Matcher { return e.On("MessageReactionAdd", rules...) } 73 74 // OnMessageReactionAdd ... 75 func OnMessageReactionAdd(rules ...Rule) *Matcher { return On("MessageReactionAdd", rules...) } 76 77 // OnMessageReactionRemove ... 78 func (e *Engine) OnMessageReactionRemove(rules ...Rule) *Matcher { return e.On("MessageReactionRemove", rules...) } 79 80 // OnMessageReactionRemove ... 81 func OnMessageReactionRemove(rules ...Rule) *Matcher { return On("MessageReactionRemove", rules...) } 82 83 // OnOpenForumThreadCreate ... 84 func (e *Engine) OnOpenForumThreadCreate(rules ...Rule) *Matcher { return e.On("OpenForumThreadCreate", rules...) } 85 86 // OnOpenForumThreadCreate ... 87 func OnOpenForumThreadCreate(rules ...Rule) *Matcher { return On("OpenForumThreadCreate", rules...) } 88 89 // OnOpenForumThreadUpdate ... 90 func (e *Engine) OnOpenForumThreadUpdate(rules ...Rule) *Matcher { return e.On("OpenForumThreadUpdate", rules...) } 91 92 // OnOpenForumThreadUpdate ... 93 func OnOpenForumThreadUpdate(rules ...Rule) *Matcher { return On("OpenForumThreadUpdate", rules...) } 94 95 // OnOpenForumThreadDelete ... 96 func (e *Engine) OnOpenForumThreadDelete(rules ...Rule) *Matcher { return e.On("OpenForumThreadDelete", rules...) } 97 98 // OnOpenForumThreadDelete ... 99 func OnOpenForumThreadDelete(rules ...Rule) *Matcher { return On("OpenForumThreadDelete", rules...) } 100 101 // OnOpenForumPostCreate ... 102 func (e *Engine) OnOpenForumPostCreate(rules ...Rule) *Matcher { return e.On("OpenForumPostCreate", rules...) } 103 104 // OnOpenForumPostCreate ... 105 func OnOpenForumPostCreate(rules ...Rule) *Matcher { return On("OpenForumPostCreate", rules...) } 106 107 // OnOpenForumPostDelete ... 108 func (e *Engine) OnOpenForumPostDelete(rules ...Rule) *Matcher { return e.On("OpenForumPostDelete", rules...) } 109 110 // OnOpenForumPostDelete ... 111 func OnOpenForumPostDelete(rules ...Rule) *Matcher { return On("OpenForumPostDelete", rules...) } 112 113 // OnOpenForumReplyCreate ... 114 func (e *Engine) OnOpenForumReplyCreate(rules ...Rule) *Matcher { return e.On("OpenForumReplyCreate", rules...) } 115 116 // OnOpenForumReplyCreate ... 117 func OnOpenForumReplyCreate(rules ...Rule) *Matcher { return On("OpenForumReplyCreate", rules...) } 118 119 // OnOpenForumReplyDelete ... 120 func (e *Engine) OnOpenForumReplyDelete(rules ...Rule) *Matcher { return e.On("OpenForumReplyDelete", rules...) } 121 122 // OnOpenForumReplyDelete ... 123 func OnOpenForumReplyDelete(rules ...Rule) *Matcher { return On("OpenForumReplyDelete", rules...) } 124 125 // OnAudioOrLiveChannelMemberEnter ... 126 func (e *Engine) OnAudioOrLiveChannelMemberEnter(rules ...Rule) *Matcher { return e.On("AudioOrLiveChannelMemberEnter", rules...) } 127 128 // OnAudioOrLiveChannelMemberEnter ... 129 func OnAudioOrLiveChannelMemberEnter(rules ...Rule) *Matcher { return On("AudioOrLiveChannelMemberEnter", rules...) } 130 131 // OnAudioOrLiveChannelMemberExit ... 132 func (e *Engine) OnAudioOrLiveChannelMemberExit(rules ...Rule) *Matcher { return e.On("AudioOrLiveChannelMemberExit", rules...) } 133 134 // OnAudioOrLiveChannelMemberExit ... 135 func OnAudioOrLiveChannelMemberExit(rules ...Rule) *Matcher { return On("AudioOrLiveChannelMemberExit", rules...) } 136 137 // OnMessageAuditPass ... 138 func (e *Engine) OnMessageAuditPass(rules ...Rule) *Matcher { return e.On("MessageAuditPass", rules...) } 139 140 // OnMessageAuditPass ... 141 func OnMessageAuditPass(rules ...Rule) *Matcher { return On("MessageAuditPass", rules...) } 142 143 // OnMessageAuditReject ... 144 func (e *Engine) OnMessageAuditReject(rules ...Rule) *Matcher { return e.On("MessageAuditReject", rules...) } 145 146 // OnMessageAuditReject ... 147 func OnMessageAuditReject(rules ...Rule) *Matcher { return On("MessageAuditReject", rules...) } 148 149 // OnForumThreadCreate ... 150 func (e *Engine) OnForumThreadCreate(rules ...Rule) *Matcher { return e.On("ForumThreadCreate", rules...) } 151 152 // OnForumThreadCreate ... 153 func OnForumThreadCreate(rules ...Rule) *Matcher { return On("ForumThreadCreate", rules...) } 154 155 // OnForumThreadUpdate ... 156 func (e *Engine) OnForumThreadUpdate(rules ...Rule) *Matcher { return e.On("ForumThreadUpdate", rules...) } 157 158 // OnForumThreadUpdate ... 159 func OnForumThreadUpdate(rules ...Rule) *Matcher { return On("ForumThreadUpdate", rules...) } 160 161 // OnForumThreadDelete ... 162 func (e *Engine) OnForumThreadDelete(rules ...Rule) *Matcher { return e.On("ForumThreadDelete", rules...) } 163 164 // OnForumThreadDelete ... 165 func OnForumThreadDelete(rules ...Rule) *Matcher { return On("ForumThreadDelete", rules...) } 166 167 // OnForumPostCreate ... 168 func (e *Engine) OnForumPostCreate(rules ...Rule) *Matcher { return e.On("ForumPostCreate", rules...) } 169 170 // OnForumPostCreate ... 171 func OnForumPostCreate(rules ...Rule) *Matcher { return On("ForumPostCreate", rules...) } 172 173 // OnForumPostDelete ... 174 func (e *Engine) OnForumPostDelete(rules ...Rule) *Matcher { return e.On("ForumPostDelete", rules...) } 175 176 // OnForumPostDelete ... 177 func OnForumPostDelete(rules ...Rule) *Matcher { return On("ForumPostDelete", rules...) } 178 179 // OnForumReplyCreate ... 180 func (e *Engine) OnForumReplyCreate(rules ...Rule) *Matcher { return e.On("ForumReplyCreate", rules...) } 181 182 // OnForumReplyCreate ... 183 func OnForumReplyCreate(rules ...Rule) *Matcher { return On("ForumReplyCreate", rules...) } 184 185 // OnForumReplyDelete ... 186 func (e *Engine) OnForumReplyDelete(rules ...Rule) *Matcher { return e.On("ForumReplyDelete", rules...) } 187 188 // OnForumReplyDelete ... 189 func OnForumReplyDelete(rules ...Rule) *Matcher { return On("ForumReplyDelete", rules...) } 190 191 // OnForumPublishAuditResult ... 192 func (e *Engine) OnForumPublishAuditResult(rules ...Rule) *Matcher { return e.On("ForumPublishAuditResult", rules...) } 193 194 // OnForumPublishAuditResult ... 195 func OnForumPublishAuditResult(rules ...Rule) *Matcher { return On("ForumPublishAuditResult", rules...) } 196 197 // OnAudioStart ... 198 func (e *Engine) OnAudioStart(rules ...Rule) *Matcher { return e.On("AudioStart", rules...) } 199 200 // OnAudioStart ... 201 func OnAudioStart(rules ...Rule) *Matcher { return On("AudioStart", rules...) } 202 203 // OnAudioFinish ... 204 func (e *Engine) OnAudioFinish(rules ...Rule) *Matcher { return e.On("AudioFinish", rules...) } 205 206 // OnAudioFinish ... 207 func OnAudioFinish(rules ...Rule) *Matcher { return On("AudioFinish", rules...) } 208 209 // OnAudioOnMic ... 210 func (e *Engine) OnAudioOnMic(rules ...Rule) *Matcher { return e.On("AudioOnMic", rules...) } 211 212 // OnAudioOnMic ... 213 func OnAudioOnMic(rules ...Rule) *Matcher { return On("AudioOnMic", rules...) } 214 215 // OnAudioOffMic ... 216 func (e *Engine) OnAudioOffMic(rules ...Rule) *Matcher { return e.On("AudioOffMic", rules...) } 217 218 // OnAudioOffMic ... 219 func OnAudioOffMic(rules ...Rule) *Matcher { return On("AudioOffMic", rules...) } 220 221 // OnMessagePrefix ... 222 func OnMessagePrefix(prefix string, rules ...Rule) *Matcher { 223 return defaultEngine.OnMessagePrefix(prefix, rules...) 224 } 225 226 // OnMessagePrefix ... 227 func (e *Engine) OnMessagePrefix(prefix string, rules ...Rule) *Matcher { 228 matcher := &Matcher{ 229 Type: "Message", 230 Rules: append([]Rule{PrefixRule(prefix)}, rules...), 231 Engine: e, 232 } 233 e.matchers = append(e.matchers, matcher) 234 return StoreMatcher(matcher) 235 } 236 237 // OnMessageSuffix ... 238 func OnMessageSuffix(suffix string, rules ...Rule) *Matcher { 239 return defaultEngine.OnMessageSuffix(suffix, rules...) 240 } 241 242 // OnMessageSuffix ... 243 func (e *Engine) OnMessageSuffix(suffix string, rules ...Rule) *Matcher { 244 matcher := &Matcher{ 245 Type: "Message", 246 Rules: append([]Rule{SuffixRule(suffix)}, rules...), 247 Engine: e, 248 } 249 e.matchers = append(e.matchers, matcher) 250 return StoreMatcher(matcher) 251 } 252 253 // OnMessageCommand ... 254 func OnMessageCommand(commands string, rules ...Rule) *Matcher { 255 return defaultEngine.OnMessageCommand(commands, rules...) 256 } 257 258 // OnMessageCommand ... 259 func (e *Engine) OnMessageCommand(commands string, rules ...Rule) *Matcher { 260 matcher := &Matcher{ 261 Type: "Message", 262 Rules: append([]Rule{CommandRule(commands)}, rules...), 263 Engine: e, 264 } 265 e.matchers = append(e.matchers, matcher) 266 return StoreMatcher(matcher) 267 } 268 269 // OnMessageRegex ... 270 func OnMessageRegex(regexPattern string, rules ...Rule) *Matcher { 271 return defaultEngine.OnMessageRegex(regexPattern, rules...) 272 } 273 274 // OnMessageRegex ... 275 func (e *Engine) OnMessageRegex(regexPattern string, rules ...Rule) *Matcher { 276 matcher := &Matcher{ 277 Type: "Message", 278 Rules: append([]Rule{RegexRule(regexPattern)}, rules...), 279 Engine: e, 280 } 281 e.matchers = append(e.matchers, matcher) 282 return StoreMatcher(matcher) 283 } 284 285 // OnMessageKeyword ... 286 func OnMessageKeyword(keyword string, rules ...Rule) *Matcher { 287 return defaultEngine.OnMessageKeyword(keyword, rules...) 288 } 289 290 // OnMessageKeyword ... 291 func (e *Engine) OnMessageKeyword(keyword string, rules ...Rule) *Matcher { 292 matcher := &Matcher{ 293 Type: "Message", 294 Rules: append([]Rule{KeywordRule(keyword)}, rules...), 295 Engine: e, 296 } 297 e.matchers = append(e.matchers, matcher) 298 return StoreMatcher(matcher) 299 } 300 301 // OnMessageFullMatch ... 302 func OnMessageFullMatch(src string, rules ...Rule) *Matcher { 303 return defaultEngine.OnMessageFullMatch(src, rules...) 304 } 305 306 // OnMessageFullMatch ... 307 func (e *Engine) OnMessageFullMatch(src string, rules ...Rule) *Matcher { 308 matcher := &Matcher{ 309 Type: "Message", 310 Rules: append([]Rule{FullMatchRule(src)}, rules...), 311 Engine: e, 312 } 313 e.matchers = append(e.matchers, matcher) 314 return StoreMatcher(matcher) 315 } 316 317 // OnMessageFullMatchGroup ... 318 func OnMessageFullMatchGroup(src []string, rules ...Rule) *Matcher { 319 return defaultEngine.OnMessageFullMatchGroup(src, rules...) 320 } 321 322 // OnMessageFullMatchGroup ... 323 func (e *Engine) OnMessageFullMatchGroup(src []string, rules ...Rule) *Matcher { 324 matcher := &Matcher{ 325 Type: "Message", 326 Rules: append([]Rule{FullMatchGroupRule(src...)}, rules...), 327 Engine: e, 328 } 329 e.matchers = append(e.matchers, matcher) 330 return StoreMatcher(matcher) 331 } 332 333 // OnMessageKeywordGroup ... 334 func OnMessageKeywordGroup(keywords []string, rules ...Rule) *Matcher { 335 return defaultEngine.OnMessageKeywordGroup(keywords, rules...) 336 } 337 338 // OnMessageKeywordGroup ... 339 func (e *Engine) OnMessageKeywordGroup(keywords []string, rules ...Rule) *Matcher { 340 matcher := &Matcher{ 341 Type: "Message", 342 Rules: append([]Rule{KeywordGroupRule(keywords...)}, rules...), 343 Engine: e, 344 } 345 e.matchers = append(e.matchers, matcher) 346 return StoreMatcher(matcher) 347 } 348 349 // OnMessageCommandGroup ... 350 func OnMessageCommandGroup(commands []string, rules ...Rule) *Matcher { 351 return defaultEngine.OnMessageCommandGroup(commands, rules...) 352 } 353 354 // OnMessageCommandGroup ... 355 func (e *Engine) OnMessageCommandGroup(commands []string, rules ...Rule) *Matcher { 356 matcher := &Matcher{ 357 Type: "Message", 358 Rules: append([]Rule{CommandGroupRule(commands...)}, rules...), 359 Engine: e, 360 } 361 e.matchers = append(e.matchers, matcher) 362 return StoreMatcher(matcher) 363 } 364 365 // OnMessagePrefixGroup ... 366 func OnMessagePrefixGroup(prefix []string, rules ...Rule) *Matcher { 367 return defaultEngine.OnMessagePrefixGroup(prefix, rules...) 368 } 369 370 // OnMessagePrefixGroup ... 371 func (e *Engine) OnMessagePrefixGroup(prefix []string, rules ...Rule) *Matcher { 372 matcher := &Matcher{ 373 Type: "Message", 374 Rules: append([]Rule{PrefixGroupRule(prefix...)}, rules...), 375 Engine: e, 376 } 377 e.matchers = append(e.matchers, matcher) 378 return StoreMatcher(matcher) 379 } 380 381 // OnMessageSuffixGroup ... 382 func OnMessageSuffixGroup(suffix []string, rules ...Rule) *Matcher { 383 return defaultEngine.OnMessageSuffixGroup(suffix, rules...) 384 } 385 386 // OnMessageSuffixGroup ... 387 func (e *Engine) OnMessageSuffixGroup(suffix []string, rules ...Rule) *Matcher { 388 matcher := &Matcher{ 389 Type: "Message", 390 Rules: append([]Rule{SuffixGroupRule(suffix...)}, rules...), 391 Engine: e, 392 } 393 e.matchers = append(e.matchers, matcher) 394 return StoreMatcher(matcher) 395 } 396 397 // OnMessageShell shell命令触发器 398 func OnMessageShell(command string, model interface{}, rules ...Rule) *Matcher { 399 return defaultEngine.OnMessageShell(command, model, rules...) 400 } 401 402 // OnMessageShell shell命令触发器 403 func (e *Engine) OnMessageShell(command string, model interface{}, rules ...Rule) *Matcher { 404 matcher := &Matcher{ 405 Type: "Message", 406 Rules: append([]Rule{ShellRule(command, model)}, rules...), 407 Engine: e, 408 } 409 e.matchers = append(e.matchers, matcher) 410 return StoreMatcher(matcher) 411 }