Skip to content

Commit

Permalink
Merge pull request #14 from valgaze/tidy
Browse files Browse the repository at this point in the history
various tidy up
  • Loading branch information
valgaze authored Nov 16, 2021
2 parents bd9ad2b + 26f6570 commit 972bc64
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
12 changes: 1 addition & 11 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,6 @@ export class $Botutils {
})
}

if (typeof chipPayload === 'string') {
let candidate: Chip = {label: ''}
candidate = {
label: chipPayload.split(' ').join('_')
}
newChips.push(candidate)
}

const chips = await this.getData(chipLabel) || []
const keys = newChips.map(({label}) => label)
const writeChips = chips.filter(chip => !keys.includes(chip.label)).concat(newChips)
Expand All @@ -520,9 +512,7 @@ export class $Botutils {
const card = new SpeedyCard().setChips(labels)
if (heading) {
card.setSubtitle(heading)
this.sendTemplate([heading], { time: new Date().toString()})
}

this.botRef.sendCard(card.render(), heading ? heading : ' ')
}

Expand Down Expand Up @@ -555,4 +545,4 @@ export interface Chip {
// args?: () => Promise<string[]>
}

export type ChipPayload = string | string[] | Chip[] | (string | Chip)[]
export type ChipPayload = string[] | Chip[] | (string | Chip)[]
1 change: 0 additions & 1 deletion src/speedybot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ import {
const submit = {
keyword: "<@submit>",
handler(bot, trigger) {
bot.say('fRAZZLESLOLOLOLOLOLOLOL')
const isChip = trigger.attachmentAction.inputs
? Boolean(trigger.attachmentAction.inputs.chip_action)
: false;
Expand Down

0 comments on commit 972bc64

Please sign in to comment.