diff --git a/src/commands/record.ts b/src/commands/record.ts index 3881f91..2893409 100644 --- a/src/commands/record.ts +++ b/src/commands/record.ts @@ -3,11 +3,13 @@ import { AbstractCommandNoResponse } from './abstractCommand' export class RecordCommand extends AbstractCommandNoResponse { filename?: string + append?: boolean - constructor (filename?: string) { + constructor (filename?: string, append?: boolean) { super() this.filename = filename + this.append = append } serialize () { @@ -17,6 +19,7 @@ export class RecordCommand extends AbstractCommandNoResponse { } if (this.filename) res.params.name = this.filename + if (this.append !== undefined) res.params.append = this.append ? 'true' : 'false' return res } diff --git a/src/commands/shuttle.ts b/src/commands/shuttle.ts new file mode 100644 index 0000000..3cd99ed --- /dev/null +++ b/src/commands/shuttle.ts @@ -0,0 +1,23 @@ +import { NamedMessage } from '../message' +import { AbstractCommandNoResponse } from './abstractCommand' + +export class SpeedCommand extends AbstractCommandNoResponse { + speed?: number + + constructor (speed?: number) { + super() + + this.speed = speed + } + + serialize () { + const res: NamedMessage = { + name: 'speed', + params: {} + } + + if (this.speed) res.params.speed = this.speed + '' + + return res + } +}