anipalur / anipalur/gce-a-levels-bot

Update buttons code snippet

Ouverte
#14 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug good first issue other
Langage dominant
JavaScript
Étoiles
1
Forks
1
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Discord Username

Not specified.

### Bug Description

The [buttons code snippet](https://github.com/anipalur/gce-a-levels-bot/blob/79c543970c4fd6cbaa94b9683e944362fa0154a8/.vscode/boilerplate.code-snippets#L5-L22 "View where the buttons code snippet is defined.") populates button data like this:

```js
const data = { name: 'button-name' };

// ...

module.exports = { data, execute };
```

This leads to an error when loading and using buttons.

### Steps to Reproduce

1. Create a new button file.
1. Type `button` and select the IntelliSense snippet.
3. Populate the button code.
4. Run the bot.
5. Use the button.

### Expected Behaviour

The button data to be like this:

```js
const id = 'button-name';

// ...

module.exports = { id, execute };
```

### Relevant Log Output

```shell
None.
```

### Relevant Screenshots

None.

### Additional Information

The custom IDs of buttons are set using `id` in `index.js`:

https://github.com/anipalur/gce-a-levels-bot/blob/79c543970c4fd6cbaa94b9683e944362fa0154a8/src/index.js#L91

And are referenced using `interaction.customId` in `interaction-create.js`:

https://github.com/anipalur/gce-a-levels-bot/blob/79c543970c4fd6cbaa94b9683e944362fa0154a8/src/events/interaction-create.js#L142

### Code of Conduct

- [X] I agree to abide by the Code of Conduct.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.