Issue with code not running after using args.rest('string') (NOT SAPPHIRE ISSUE)

public async messageLink(message: Message, args: Args) {
let region = 'na';
let summoner_name;

console.log('Message Content: ' + message.content);

if (message.content.split(' ').length > 2) {
const regionText = await args.pick('string');

console.log('Region Text: ' + regionText);
if (RiotUtil.isRegion(regionText)) {
region = regionText;
} else {
summoner_name = regionText;
}
}

console.log('Region 1: ' + region);
console.log('Summoner Name 1: ' + summoner_name);


if(summoner_name) {
console.log('region was not specified, combining all args');
summoner_name = summoner_name + await args.rest('string');
console.log('Summoner Name 1.5: ' + summoner_name);
} else {
console.log('region was specified, setting summoner name');
summoner_name = await args.rest('string');
}

console.log('Region 2: ' + region);
console.log('Summoner Name 2: ' + summoner_name);
}
public async messageLink(message: Message, args: Args) {
let region = 'na';
let summoner_name;

console.log('Message Content: ' + message.content);

if (message.content.split(' ').length > 2) {
const regionText = await args.pick('string');

console.log('Region Text: ' + regionText);
if (RiotUtil.isRegion(regionText)) {
region = regionText;
} else {
summoner_name = regionText;
}
}

console.log('Region 1: ' + region);
console.log('Summoner Name 1: ' + summoner_name);


if(summoner_name) {
console.log('region was not specified, combining all args');
summoner_name = summoner_name + await args.rest('string');
console.log('Summoner Name 1.5: ' + summoner_name);
} else {
console.log('region was specified, setting summoner name');
summoner_name = await args.rest('string');
}

console.log('Region 2: ' + region);
console.log('Summoner Name 2: ' + summoner_name);
}
https://i.imgur.com/UF6eC5d.png What am I missing here that is producing these results? Is this something weird with TypeScript or am I misunderstand Args. It seems to just stop running and doesn't get to the bottom two console log outputs, or even the one directly below the line of code
Imgur
Solution:
Not a Sapphire related issue
Jump to solution
1 Reply
Solution
Baylem
Baylem12mo ago
Not a Sapphire related issue
Want results from more Discord servers?
Add your server