Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Factorisation de la génération des routes des commandes slash et du manifest #116

Merged
merged 3 commits into from
Apr 27, 2022

Conversation

francois2metz
Copy link
Contributor

🦄 Problème

Les manifest créées dans #114 sont décoléré du code. Il faut donc les maintenir a part. On a en plus de la duplication de la logique plutôt que de rendre l'intention de créer des commandes slash explicite.

🤖 Solution

Créer un modèle de manifest qui prend un nom et qui permet d'enregistrer des commandes slash. On utilise ensuite ce modèle pour retourner le manifest et générer les routes hapi.

🌈 Remarques

Ce modèle de manifest n'est pas encore complet. Il a vocation a évoluer avec les commandes interactives typiquement.

💯 Pour tester

  1. Vérifier que les tests sont bien au vert
  2. Constater que les manifest n'ont pas changé
  3. Vérifier les commandes slash

@francois2metz francois2metz added Tech Review Needed team-captains This is your captain speaking labels Apr 26, 2022
@francois2metz francois2metz self-assigned this Apr 26, 2022
});

// then
expect(manifest.slashCommands).to.have.lengthOf(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

expect(manifest.slashCommands).to.deepEqual([
    {
        command: '/test',
        path: '/command/test',
        description: 'My test command',
        usage_hint: 'this is a test',
        should_escape: false,
        handler() { }
      }
]);

Base automatically changed from move-common to main April 27, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Ready to Merge team-captains This is your captain speaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants