forked from ChrisChrome/weather-bot
# Major Bug Fix
- "You had it set to 'W' for Wumbo, when you should've had it set to 'M' for mini." Fixed a small issue involving capitalization. TL;DR Fixed evtFilter for guild channels :)
This commit is contained in:
parent
aac1420964
commit
98673be5c7
10
index.js
10
index.js
|
@ -423,14 +423,14 @@ xmpp.on("stanza", (stanza) => {
|
||||||
if (!rows) return; // No channels to alert
|
if (!rows) return; // No channels to alert
|
||||||
rows.forEach((row) => {
|
rows.forEach((row) => {
|
||||||
// Get Filters as arrays
|
// Get Filters as arrays
|
||||||
if (!row.filterEvt) row.filterEvt = "";
|
if (!row.filterevt) row.filterevt = "";
|
||||||
if (!row.filter) row.filter = "";
|
if (!row.filter) row.filter = "";
|
||||||
let filterEvt = row.filterEvt.toLowerCase().split(",");
|
let filterevt = row.filterevt.toLowerCase().split(",");
|
||||||
let filters = row.filter.toLowerCase().split(",");
|
let filters = row.filter.toLowerCase().split(",");
|
||||||
if (evt.priority < row.minPriority) return;
|
if (evt.priority < row.minPriority) return;
|
||||||
// If the event type is not in th filter, ignore it. Make sure filterEvt isnt null
|
// If the event type is not in th filter, ignore it. Make sure filterevt isnt null
|
||||||
if (!filterEvt[0]) filterEvt = [];
|
if (!filterevt[0]) filterevt = [];
|
||||||
if (!filterEvt.includes(evt.code.toLowerCase()) && !filterEvt.length == 0) return;
|
if (!filterevt.includes(evt.code.toLowerCase()) && !filterevt.length == 0) return;
|
||||||
|
|
||||||
let channel = discord.channels.cache.get(row.channelid);
|
let channel = discord.channels.cache.get(row.channelid);
|
||||||
if (!channel) return console.log(`${colors.red("[ERROR]")} Channel ${row.channelid} not found`);
|
if (!channel) return console.log(`${colors.red("[ERROR]")} Channel ${row.channelid} not found`);
|
||||||
|
|
Loading…
Reference in a new issue