Skip to content

v1.0.12

Compare
Choose a tag to compare
@valgaze valgaze released this 16 Nov 14:44
  • Merge pull request #15 from valgaze/chipfix 4c876fa
  • add feature to make chips disappear on tap c6176ef

v1.0.11...v1.0.12

Disappear

$bot.setChipsConfig({disappearOnTap: true})

image

Persist (default)

$bot.setChipsConfig({disappearOnTap: false})

image

ex.

	{
		keyword: 'chips',
		async handler(bot) {
			const $bot = $(bot)

			// Set chips to disappear after tap
			$bot.setChipsConfig({disappearOnTap: true})

			// Send chip with custom handler
			const customChip = { 
				label: 'custom chip', 
				handler(bot:BotInst, trigger: Trigger) {
					$bot.sendSnippet(trigger, `**The 'custom chip' was tapped**	`)
					$bot.$trigger('chips', trigger) // re-render chips
				}
			}

			// Add optional title
			$bot.sendChips(['hey', 'ping', '$', 'pong', customChip], 'These chips will disappear on tap')
		},
		helpText: 'Returns a sample list of "chips"'
	}