Hello i'm trying to make a command but can't find a way to get the string from the Message type argument, here is my code :
event.register(
Commands.literal('setCompetences').requires((s) => s.hasPermission(2))
.then(
Commands.argument("player",Arguments.PLAYER.create(event))
.then(
Commands.argument("competences",Arguments.MESSAGE.create(event)).executes(
c => {
let player = Arguments.PLAYER.getResult(c, "player")
/** @type {Internal.Message} */
let competences = Arguments.MESSAGE.getResult(c, "competences");
c.source.player.sendSystemMessage(typeof competences);
competences = competences.getText()
competences.split(" ");
competences = convertTextToInt(competences);
if (!setCompetences(player, competencesListe)){
console.error("Il manque un argument")
return 0
}
return 1
})
)));