You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
230 lines
5.0 KiB
230 lines
5.0 KiB
4 years ago
|
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.",
|
||
|
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)
|
||
|
}
|