Skip to content

Commit f120436

Browse files
Change authentication message to be an error instead of normal ephemeral message for all faculty commands
1 parent aa3cc6c commit f120436

19 files changed

+20
-20
lines changed

src/discordBot/commands/faculty/add_instructors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { courseAdminRole, facultyRole } = require("../../../../config.json");
88

99
const execute = async (interaction, client, models) => {
1010
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) { // Olisiko parempi tarkistaa tietokannasta eikä discordista?
11-
await sendEphemeral(interaction, "You do not have permission to use this command.");
11+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1212
return
1313
}
1414

src/discordBot/commands/faculty/create_channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { facultyRole } = require("../../../../config.json");
77

88
const execute = async (interaction, client, models) => {
99
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
10-
await sendEphemeral(interaction, "You do not have permission to use this command.");
10+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1111
return
1212
}
1313

src/discordBot/commands/faculty/create_course.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const { sendErrorEphemeral, sendEphemeral, editEphemeral } = require("../../serv
88
const { facultyRole } = require("../../../../config.json");
99

1010
const execute = async (interaction, client, models) => {
11-
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
12-
await sendEphemeral(interaction, "You do not have permission to use this command.");
11+
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
12+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1313
return
1414
}
1515

src/discordBot/commands/faculty/create_poll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const numbers = [ "1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️
88

99
const execute = async (interaction, client) => {
1010
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
11-
await sendEphemeral(interaction, "You do not have permission to use this command.");
11+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1212
return
1313
}
1414

src/discordBot/commands/faculty/delete_bridge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { sendMessageToTelegram } = require("../../../telegramBot/bridge/service")
88

99
const execute = async (interaction, client, models) => {
1010
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
11-
await sendEphemeral(interaction, "You do not have permission to use this command.");
11+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1212
return
1313
}
1414

src/discordBot/commands/faculty/delete_channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { facultyRole } = require("../../../../config.json");
88

99
const execute = async (interaction, client, models) => {
1010
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
11-
await sendEphemeral(interaction, "You do not have permission to use this command.");
11+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1212
return
1313
}
1414

src/discordBot/commands/faculty/disable_bridge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { facultyRole } = require("../../../../config.json");
88

99
const execute = async (interaction, client, models) => {
1010
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
11-
await sendEphemeral(interaction, "You do not have permission to use this command.");
11+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1212
return
1313
}
1414

src/discordBot/commands/faculty/edit_course.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const changeCourseNick = async (interaction, client, models, courseName, newValu
6767

6868
const execute = async (interaction, client, models) => {
6969
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
70-
await sendEphemeral(interaction, "You do not have permission to use this command.");
70+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
7171
return
7272
}
7373

src/discordBot/commands/faculty/edit_topic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { saveChannelTopicToDb } = require("../../../db/services/channelService");
1212

1313
const execute = async (interaction, client, models) => {
1414
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
15-
await sendEphemeral(interaction, "You do not have permission to use this command.");
15+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1616
return
1717
}
1818

src/discordBot/commands/faculty/enable_bridge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { facultyRole } = require("../../../../config.json");
88

99
const execute = async (interaction, client, models) => {
1010
if (!interaction.member.permissions.has("ADMINISTRATOR") && !interaction.member.roles.cache.some(r => r.name === facultyRole)) {
11-
await sendEphemeral(interaction, "You do not have permission to use this command.");
11+
await sendErrorEphemeral(interaction, "You do not have permission to use this command.");
1212
return
1313
}
1414

0 commit comments

Comments
 (0)