2.5.0 • Published 2 years ago

foguete-buttons v2.5.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

Foguete-buttons Version

About

Foguete-buttons is a light-weight npm for use easily buttons & dropdowns.

Supported Versions

VersionSupported
2.4.0:white_check_mark:
>= 2.3.0:x:

Do NOT report a bug if the version is marked as unsupported.

Changelog

Fixed README.md, added disabled to messageButtons.

Usage of MessageButton

    const { MessageButton } = require('foguete-buttons')

    new MessageButton()
      .createButton({ 
        content: 'Hey!',
          embed: {
            title: 'Hello, title!',
            thumbnail: { url: 'https://someimage.com' }
            description: "What's on?",
            color: 'a decimal color'
            footer: {
              text: 'Hi, footer',
              iconURL: 'https://someimage.com'
            },
            image: { url: 'https://someimage.com' }
            video: { url: 'https://somevideo.com' }
          },
          buttons: [{
            label: 'click here',
            color: '1',
            isUrlButton: false,
            id: 'test',
            emoji_name: 'mouse',
            emoji_id: '230127013721301'
       }, { 
            label: 'dont click here',
            color: '4',
            isUrlButton: true,
            url: 'https://google.com',
          }
        ], channel: 'channelID', token: 'token' })
    ```

    ## Usage of dropdown

    ```js
      const { messageDropdown } = require('foguete-buttons')

      new MessageDropdown()
        .createDropdown({
          content: 'hey',
          embed: null,
          custom_id: 'test_message',
          text: 'Choose one of them!',
          min_values: '1',
          max_values: '1',
          dropdowns: [{
            label: 'abc',
            id: 'first_option',
            description: 'abc is the first letters!',
            emoji_id: '780546909029924894',
            emoji_name: 'nodejs'
          }, {
            label: 'def',
            id: 'another_option',
            description: "Hey, I'm powered with foguete-buttons!"
          }
        ], channel: 'channelID', token: 'token' })
    ```

    ## Respond to the button / dropdown

    Obs: I don't recommend using the v13 interactionCreate event.

    ```js
      client.ws.on('INTERACTION_CREATE', (data) => {
        client.api.interactions(data.id, data.token).callback.post({
          data: {
            type: 7,
            data: {
              content: "What's on?",
            }
          }
        })  
      })
    ```

You can see more types in this image.
![Types](https://i.imgur.com/e6qLe3v.png)

# Observation

  For use as slash command response, add the field "slash" with "type", "id" and "token" fields
2.5.0

2 years ago

2.4.0

2 years ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.7

3 years ago

2.0.3

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.6

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

2.0.0-beta

3 years ago

1.9.0

3 years ago

1.7.2

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.7.8

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.0.7

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.5

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago