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

BUG #39

Open
SnkyFrsh opened this issue May 30, 2023 · 0 comments
Open

BUG #39

SnkyFrsh opened this issue May 30, 2023 · 0 comments
Assignees

Comments

@SnkyFrsh
Copy link

Is there anyway to have the !? return its output in a single reply?

I believe its this section that is handled under app/music.js

if (msg.startsWith(bot.config.caracteres_commande)){
        if(bot.config.canal_ecoute == '' || message.channel.name == bot.config.canal_ecoute) {
            var cmdTxt = msg.split(/\s+/)[0].substring(bot.config.caracteres_commande.length, msg.length).toLowerCase();
            var query = msg.substring(cmdTxt.length+2);
            if(cmdTxt === "?") {
              if(query) {
                /*let cmdTxtAide = query.split(" ");
                let cmdAide = plexCommands[cmdTxtAide[0]];
                if(cmdAide) {
                  cmdAide.usage(message, cmdTxtAide.slice(1));
                } else{*/
                  message.reply(bot.language.MUSIC_HELP_1.format({caracteres_commande : bot.config.caracteres_commande}),{tts: true});
                //}
                return ;
              }
              for (let command in plexCommands){
                  let embedObj = {
                          embed: {
                              color: 4251856,
                              fields:
                              [
                                  {
                                      name: bot.language.COMMAND,
                                      value: bot.config.caracteres_commande + command + ' ' + plexCommands[command].usage,
                                      inline: true
                                  },
                                  {
                                      name: bot.language.DESCRIPTION,
                                      value: plexCommands[command].description,
                                      inline: true
                                  }
                              ],
                              footer: {
                                  text: ''
                              },
                          }
                  };
                  message.channel.send('\n**' + command + ' :**\n\n', embedObj);
              }
              return ;
            }
            
            var cmd = plexCommands[cmdTxt];
            
            if (cmd){
              try {
                cmd.process(bot, client, message, query);
                if (process.catch !== undefined) {
                  process.catch(err => console.log(e));
                }
              }
              catch (e) {
                console.log(e);
              }
            }
            else {
              message.reply(bot.language.MUSIC_UNKNOW_COMMAND.format({cmdTxt : cmdTxt}));
            }
        }
      }

Asking as the current is quite spammy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants