-
Notifications
You must be signed in to change notification settings - Fork 86
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
Is there going to be a v13 version soon? #4
Comments
I'm not sure if this repository is still active, but if need the transcriber for v13, then have a look at this. I'll be publishing a music bot with voice commands soon :) |
You can then use something like this to parse the commands: function parse(string, possible) {
let output = string.repeat(1);
string = string.replace("/\./g", "");
string = string.toLowerCase().replace("music", "").trim();
if (string.includes(" ")) string = string.split(" ")[0];
string = string.trim();
if (!possible.includes(string)) return false;
output = output.replace(/\./g, "").toLowerCase().replace("music", "").trim();
return output;
}
// Usage:
let command = parse(transcribedText, ["play", "pause", "resume", "skip", "shuffle", "list"]); It will give you a well-formated command or false (if not valid) for further processing. ("play ...", "pause ...", "resume ....", ...) |
All-in-all you can do something like this: connection.receiver.speaking.on("start", (userId) => {
const user = client.users.cache.get(userId);
console.log("Listening to " + user.username);
transcriber.listen(connection.receiver, userId, user).then((data) => {
if (!data.transcript.text) return;
let parsed = parse(data.transcript.text, ["play", "pause", "resume", "skip", "shuffle", "list"]);
if (!parsed) {return;}
// do whatever you want with the parsed command
executeVoiceCommand(parsed);
});
}); Where you have to put this snippet, is declared in the Transcriber repository Happy coding :D |
You are an amazing individual. Thank you, and make sure to have a fantastic day! |
I'm glad I could help :) |
I published the discord bot. Feel free to test it :) |
I'll test it out when I get free soon! Thank you so much!! |
No description provided.
The text was updated successfully, but these errors were encountered: