|
|
@ -227,54 +227,68 @@ func setupCommands() { |
|
|
|
} |
|
|
|
} |
|
|
|
commands = append(commands, trunk) |
|
|
|
commands = append(commands, trunk) |
|
|
|
|
|
|
|
|
|
|
|
startCharging := BotCommand { |
|
|
|
startCharging := BotCommand{ |
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{ |
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{ |
|
|
|
Typ: "public", |
|
|
|
Typ: "public", |
|
|
|
Commands: []chat1.UserBotCommandInput{ |
|
|
|
Commands: []chat1.UserBotCommandInput{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "startcharge", |
|
|
|
Name: "startcharge", |
|
|
|
Description: "Start charging (if plugged in)", |
|
|
|
Description: "Start charging (if plugged in)", |
|
|
|
Usage: "", |
|
|
|
Usage: "", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
Triggers: []string{"startcharge", "startc"}, |
|
|
|
Triggers: []string{"startcharge", "startc"}, |
|
|
|
Exec: startCharge, |
|
|
|
Exec: startCharge, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
commands = append(commands, startCharging) |
|
|
|
commands = append(commands, startCharging) |
|
|
|
|
|
|
|
|
|
|
|
stopCharging := BotCommand { |
|
|
|
stopCharging := BotCommand{ |
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{ |
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{ |
|
|
|
Typ: "public", |
|
|
|
Typ: "public", |
|
|
|
Commands: []chat1.UserBotCommandInput{ |
|
|
|
Commands: []chat1.UserBotCommandInput{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "stopcharge", |
|
|
|
Name: "stopcharge", |
|
|
|
Description: "Stop charging (if plugged in)", |
|
|
|
Description: "Stop charging (if plugged in)", |
|
|
|
Usage: "", |
|
|
|
Usage: "", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
Triggers: []string{"stopcharge", "stopc"}, |
|
|
|
Triggers: []string{"stopcharge", "stopc"}, |
|
|
|
Exec: stopCharge, |
|
|
|
Exec: stopCharge, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
commands = append(commands, stopCharging) |
|
|
|
commands = append(commands, stopCharging) |
|
|
|
|
|
|
|
|
|
|
|
delayCommand := BotCommand { |
|
|
|
delayCommand := BotCommand{ |
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{ |
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{ |
|
|
|
Typ: "public", |
|
|
|
Typ: "public", |
|
|
|
Commands: []chat1.UserBotCommandInput{ |
|
|
|
Commands: []chat1.UserBotCommandInput{ |
|
|
|
{ |
|
|
|
{ |
|
|
|
Name: "in", |
|
|
|
Name: "in", |
|
|
|
Description: "Delay a command to run at another time.", |
|
|
|
Description: "Delay a command to run at another time.", |
|
|
|
Usage: "2h3m startcharge", |
|
|
|
Usage: "2h3m startcharge", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
Triggers: []string{"in", "delay", "wait"}, |
|
|
|
Triggers: []string{"in", "delay", "wait"}, |
|
|
|
Exec: deferTime, |
|
|
|
Exec: deferTime, |
|
|
|
} |
|
|
|
} |
|
|
|
commands = append(commands, delayCommand) |
|
|
|
commands = append(commands, delayCommand) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
locateCommand := BotCommand{ |
|
|
|
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{ |
|
|
|
|
|
|
|
Typ: "public", |
|
|
|
|
|
|
|
Commands: []chat1.UserBotCommandInput{ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name: "locate", |
|
|
|
|
|
|
|
Description: "Locate your Tesla.", |
|
|
|
|
|
|
|
Usage: "", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
Triggers: []string{"locate", "map", "where","find"}, |
|
|
|
|
|
|
|
Exec: locateVehicle, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
commands = append(commands, locateCommand) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|