| 87 | | global bMotionInfo |
| 88 | | bMotion_putloglev 3 * "interbot: incoming !$args!" |
| 89 | | set args [lindex $args 0] |
| 90 | | regexp {([^ ]+) (.+)} $args matches function params |
| 91 | | |
| 92 | | bMotion_putloglev 2 * "interbot: got command $function ($params) from $bot" |
| 93 | | |
| 94 | | switch -exact $function { |
| 95 | | "say" { |
| 96 | | # bmotion say <channel> <text> |
| 97 | | bMotionCatchSayChan $bot $params |
| 98 | | } |
| 99 | | |
| 100 | | "elect_initial" { |
| 101 | | bMotion_interbot_next_incoming $bot $params |
| 102 | | } |
| 103 | | |
| 104 | | "elect_reply" { |
| 105 | | bMotion_interbot_next_incoming_reply $bot $params |
| 106 | | } |
| 107 | | |
| 108 | | "fake_event" { |
| 109 | | bMotion_interbot_fake_catch $bot $params |
| 110 | | } |
| 111 | | |
| 112 | | "HAY" { |
| 113 | | bMotion_interbot_hay $bot $params |
| 114 | | } |
| 115 | | |
| 116 | | "SUP" { |
| 117 | | bMotion_interbot_sup $bot $params |
| 118 | | } |
| 119 | | } |
| 120 | | |
| 121 | | return 0 |
| | 87 | global bMotionInfo |
| | 88 | bMotion_putloglev 3 * "interbot: incoming !$args!" |
| | 89 | set args [lindex $args 0] |
| | 90 | if [regexp {([^ ]+) (.+)} $args matches function params] { |
| | 91 | |
| | 92 | bMotion_putloglev 2 * "interbot: got command $function ($params) from $bot" |
| | 93 | |
| | 94 | switch -exact $function { |
| | 95 | "say" { |
| | 96 | # bmotion say <channel> <text> |
| | 97 | bMotionCatchSayChan $bot $params |
| | 98 | } |
| | 99 | |
| | 100 | "elect_initial" { |
| | 101 | bMotion_interbot_next_incoming $bot $params |
| | 102 | } |
| | 103 | |
| | 104 | "elect_reply" { |
| | 105 | bMotion_interbot_next_incoming_reply $bot $params |
| | 106 | } |
| | 107 | |
| | 108 | "fake_event" { |
| | 109 | bMotion_interbot_fake_catch $bot $params |
| | 110 | } |
| | 111 | |
| | 112 | "HAY" { |
| | 113 | bMotion_interbot_hay $bot $params |
| | 114 | } |
| | 115 | |
| | 116 | "SUP" { |
| | 117 | bMotion_interbot_sup $bot $params |
| | 118 | } |
| | 119 | } |
| | 120 | } else { |
| | 121 | putlog "bMotion: ERROR: received unparsable interbot command from $bot: $cmd $args" |
| | 122 | } |
| | 123 | |
| | 124 | return 0 |