Compare commits

..

No commits in common. "5e861e3c8e28c4704152f6dab088446e5466357c" and "a81d84a5b88a46fc18b5a4f7159beb5b037afaf0" have entirely different histories.

View file

@ -837,7 +837,7 @@ discord.on("interactionCreate", async (interaction) => {
console.error(err.message); console.error(err.message);
interaction.reply({ content: "Failed to subscribe to room", ephemeral: true }); interaction.reply({ content: "Failed to subscribe to room", ephemeral: true });
} else if (row) { } else if (row) {
return interaction.reply({ content: `Already subscribed to \`${getWFOByRoom(room).location}\`\nIf you want to update a subscription, please unsubscribe and resubscribe. This will be made a command eventually.`, ephemeral: true }); return interaction.reply({ content: `Already subscribed to \`${getWFOByRoom(room).location}\`\nIf you want to update a subscribtion, please unsubscribe and resubscribe. This will be made a command eventually.`, ephemeral: true });
} }
db.run(`INSERT INTO channels (channelid, iemchannel, custommessage, filter, filterEvt, minPriority) VALUES (?, ?, ?, ? ,? ,?)`, [interaction.channel.id, room, message, filter, filterEvt, minPriority], (err) => { db.run(`INSERT INTO channels (channelid, iemchannel, custommessage, filter, filterEvt, minPriority) VALUES (?, ?, ?, ? ,? ,?)`, [interaction.channel.id, room, message, filter, filterEvt, minPriority], (err) => {
if (err) { if (err) {
@ -857,7 +857,7 @@ discord.on("interactionCreate", async (interaction) => {
console.error(err.message); console.error(err.message);
interaction.reply({ content: "Failed to subscribe to room", ephemeral: true }); interaction.reply({ content: "Failed to subscribe to room", ephemeral: true });
} else if (row) { } else if (row) {
return interaction.reply({ content: `Already subscribed to \`${getWFOByRoom(room).location}\`\nIf you want to update a subscription, please unsubscribe and resubscribe. This will be made a command eventually.`, ephemeral: true }); return interaction.reply({ content: `Already subscribed to \`${getWFOByRoom(room).location}\`\nIf you want to update a subscribtion, please unsubscribe and resubscribe. This will be made a command eventually.`, ephemeral: true });
} }
db.run(`INSERT INTO userAlerts (userid, iemchannel, custommessage, filter, filterEvt, minPriority) VALUES (?, ?, ?, ? ,?, ?)`, [interaction.user.id, room, message, filter, filterEvt, minPriority], (err) => { db.run(`INSERT INTO userAlerts (userid, iemchannel, custommessage, filter, filterEvt, minPriority) VALUES (?, ?, ?, ? ,?, ?)`, [interaction.user.id, room, message, filter, filterEvt, minPriority], (err) => {
if (err) { if (err) {
@ -877,7 +877,7 @@ discord.on("interactionCreate", async (interaction) => {
interaction.reply({ content: "Invalid room", ephemeral: true }); interaction.reply({ content: "Invalid room", ephemeral: true });
return; return;
} }
await interaction.deferReply({ ephemeral: true }); interaction.deferReply({ ephemeral: true });
if (interaction.inGuild()) { if (interaction.inGuild()) {
// Check if subbed // Check if subbed
db.get(`SELECT * FROM channels WHERE channelid = ? AND iemchannel = ?`, [interaction.channel.id, room], (err, row) => { db.get(`SELECT * FROM channels WHERE channelid = ? AND iemchannel = ?`, [interaction.channel.id, room], (err, row) => {