Skip to content

Commit

Permalink
Update d.learn /properly/
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Dec 13, 2023
1 parent 9834a42 commit 10624a0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/discord/commands/global/d.learn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ async function moodleHelp():Promise<EmbedBuilder> {
async function moodleLink(
interaction:ChatInputCommandInteraction,
):Promise<EmbedBuilder> {
// Check if the discordId option was used
if (interaction.options.getString('discordId')) {
// Check if the discord_id option was used
if (interaction.options.getString('discord_id')) {
if (interaction.user.id !== env.DISCORD_OWNER_ID) {
return embedTemplate()
.setColor(Colors.Red)
Expand All @@ -50,7 +50,7 @@ async function moodleLink(
return embedTemplate()
.setDescription(await link(
interaction.options.getString('email', true),
interaction.options.getString('discordId', true),
interaction.options.getString('discord_id', true),
));
}

Expand All @@ -71,15 +71,15 @@ async function moodleLink(
async function moodleUnlink(
interaction:ChatInputCommandInteraction,
):Promise<EmbedBuilder> {
if (interaction.options.getString('discordId')) {
if (interaction.options.getString('discord_id')) {
if (interaction.user.id !== env.DISCORD_OWNER_ID) {
return embedTemplate()
.setColor(Colors.Red)
.setDescription('You are not allowed to use this option!');
}
return embedTemplate()
.setDescription(await unlink(
interaction.options.getString('discordId', true),
interaction.options.getString('discord_id', true),
));
}

Expand Down Expand Up @@ -198,12 +198,12 @@ export const dLearn: SlashCommand = {
.addStringOption(option => option.setName('email')
.setDescription('What email did you use to register on moodle?')
.setRequired(true))
.addStringOption(option => option.setName('discordId')
.addStringOption(option => option.setName('discord_id')
.setDescription('Ignore this, admin use only!')))
.addSubcommand(subcommand => subcommand
.setName('unlink')
.setDescription('Unlink your discord with your TripSitLearn account')
.addStringOption(option => option.setName('discordId')
.addStringOption(option => option.setName('discord_id')
.setDescription('Ignore this, admin use only!')))
.addSubcommand(subcommand => subcommand
.setName('profile')
Expand Down

0 comments on commit 10624a0

Please sign in to comment.