|
|
|
package main
|
|
|
|
|
|
|
|
import "samhofi.us/x/keybase/v2/types/chat1"
|
|
|
|
|
|
|
|
func setupCommands() {
|
|
|
|
authenticate := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "authenticate",
|
|
|
|
Description: "Authenticate with Tesla, please use exploding message for username/password OR a token.",
|
|
|
|
Usage: "email@example.com Pa$$w0rd",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"authenticate", "auth"},
|
|
|
|
Exec: authenticate,
|
|
|
|
}
|
|
|
|
commands = append(commands, authenticate)
|
|
|
|
|
|
|
|
reset := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "reset",
|
|
|
|
Description: "reset bot data",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"reset"},
|
|
|
|
Exec: reset,
|
|
|
|
}
|
|
|
|
commands = append(commands, reset)
|
|
|
|
|
|
|
|
list := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "list",
|
|
|
|
Description: "list account vehicles",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"list", "cars"},
|
|
|
|
Exec: listVehicles,
|
|
|
|
}
|
|
|
|
commands = append(commands, list)
|
|
|
|
|
|
|
|
honk := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "honk",
|
|
|
|
Description: "honk your vehicle horn",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"honk", "beep"},
|
|
|
|
Exec: honk,
|
|
|
|
}
|
|
|
|
commands = append(commands, honk)
|
|
|
|
|
|
|
|
charge := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "charge",
|
|
|
|
Description: "charge status",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"charge", "battery"},
|
|
|
|
Exec: chargeStatus,
|
|
|
|
}
|
|
|
|
commands = append(commands, charge)
|
|
|
|
|
|
|
|
flash := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "flash",
|
|
|
|
Description: "flash your lights",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"flash", "blink"},
|
|
|
|
Exec: flashLights,
|
|
|
|
}
|
|
|
|
commands = append(commands, flash)
|
|
|
|
|
|
|
|
climate := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "climate",
|
|
|
|
Description: "Set the climate temp, or turn 'on' or 'off'",
|
|
|
|
Usage: "64",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"climate", "ac"},
|
|
|
|
Exec: setClimate,
|
|
|
|
}
|
|
|
|
commands = append(commands, climate)
|
|
|
|
|
|
|
|
temp := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "temp",
|
|
|
|
Description: "Get current temp state/settings",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"temp", "currenttemp"},
|
|
|
|
Exec: currentTemp,
|
|
|
|
}
|
|
|
|
commands = append(commands, temp)
|
|
|
|
|
|
|
|
lock := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "lock",
|
|
|
|
Description: "Lock your vehicle",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"lock"},
|
|
|
|
Exec: lockVehicle,
|
|
|
|
}
|
|
|
|
commands = append(commands, lock)
|
|
|
|
|
|
|
|
unlock := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "unlock",
|
|
|
|
Description: "Unlock your vehicle",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"unlock"},
|
|
|
|
Exec: unlockVehicle,
|
|
|
|
}
|
|
|
|
commands = append(commands, unlock)
|
|
|
|
|
|
|
|
enableStart := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "enablestart",
|
|
|
|
Description: "Enable starting your vehicle",
|
|
|
|
Usage: "accept Pa$$w0rd",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"enablestart", "enable"},
|
|
|
|
Exec: enableStart,
|
|
|
|
}
|
|
|
|
commands = append(commands, enableStart)
|
|
|
|
|
|
|
|
disableStart := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "disablestart",
|
|
|
|
Description: "Remove your password from KVStore",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"disable", "disablestart"},
|
|
|
|
Exec: disableStart,
|
|
|
|
}
|
|
|
|
commands = append(commands, disableStart)
|
|
|
|
|
|
|
|
start := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "start",
|
|
|
|
Description: "Start your vehicle, if enabled",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"start", "remotestart"},
|
|
|
|
Exec: startVehicle,
|
|
|
|
}
|
|
|
|
commands = append(commands, start)
|
|
|
|
|
|
|
|
trunk := BotCommand{
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "trunk",
|
|
|
|
Description: "Open your trunk, front or rear",
|
|
|
|
Usage: "front",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"trunk", "boot"},
|
|
|
|
Exec: openTrunk,
|
|
|
|
}
|
|
|
|
commands = append(commands, trunk)
|
|
|
|
|
|
|
|
startCharging := BotCommand {
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "startcharge",
|
|
|
|
Description: "Start charging (if plugged in)",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"startcharge", "startc"},
|
|
|
|
Exec: startCharge,
|
|
|
|
|
|
|
|
}
|
|
|
|
commands = append(commands, startCharging)
|
|
|
|
|
|
|
|
stopCharging := BotCommand {
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "stopcharge",
|
|
|
|
Description: "Stop charging (if plugged in)",
|
|
|
|
Usage: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"stopcharge", "stopc"},
|
|
|
|
Exec: stopCharge,
|
|
|
|
|
|
|
|
}
|
|
|
|
commands = append(commands, stopCharging)
|
|
|
|
|
|
|
|
delayCommand := BotCommand {
|
|
|
|
Advert: chat1.AdvertiseCommandAPIParam{
|
|
|
|
Typ: "public",
|
|
|
|
Commands: []chat1.UserBotCommandInput{
|
|
|
|
{
|
|
|
|
Name: "in",
|
|
|
|
Description: "Delay a command to run at another time.",
|
|
|
|
Usage: "2h3m startcharge",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Triggers: []string{"in", "delay", "wait"},
|
|
|
|
Exec: deferTime,
|
|
|
|
}
|
|
|
|
commands = append(commands, delayCommand)
|
|
|
|
|
|
|
|
}
|