Skip to content

Commit

Permalink
fix: crash on add summoner error
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Jan 13, 2024
1 parent 3f65c04 commit e52c8c7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/commands/manageSummoners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ export class ManageSummoner {
tag: string,
interaction: CommandInteraction
) {
console.log("addSummoner", name);
const riotSummoner = await getSummonerByName(name, tag || "EUW");

await addSummoner(riotSummoner, interaction.channelId);
interaction.reply("Added summoner " + name);
try {
console.log("addSummoner", name);
const riotSummoner = await getSummonerByName(name, tag || "EUW");

await addSummoner(riotSummoner, interaction.channelId);
interaction.reply("Added summoner " + name + "#" + tag || "EUW");
} catch (e) {
console.log(e);
interaction.reply("Summoner not found");
}
}

@Slash({ name: "removesummoner", description: "Remove a summoner from the list of summoners to track" })
Expand Down

0 comments on commit e52c8c7

Please sign in to comment.