Spaces:
Paused
Paused
Download plugins/poll.js from levantermd/lyfe1: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/spaces/levantermd/lyfe1/resolve/main/plugins/poll.js
- Command line
-
hf download hf://spaces/levantermd/lyfe1/plugins/poll.js
-
curl -L -o poll.js https://huggingface.co/spaces/levantermd/lyfe1/resolve/main/plugins/poll.js
559 Bytes
| const { bot } = require('../lib/') | |
| bot( | |
| { | |
| pattern: 'poll ?(.*)', | |
| desc: 'poll', | |
| type: 'whatsapp', | |
| }, | |
| async (message, match) => { | |
| const poll = match.split(',') | |
| if (poll.length < 3) return await message.send('*Example : question,option1,option2,...*') | |
| const name = poll[0] | |
| const options = [] | |
| for (let i = 1; i < poll.length; i++) options.push({ optionName: poll[i] }) | |
| await message.send( | |
| { | |
| name, | |
| options, | |
| selectableOptionsCount: options.length, | |
| }, | |
| {}, | |
| 'poll' | |
| ) | |
| } | |
| ) | |