forked from ChrisChrome/weather-bot
bwuuuuh
This commit is contained in:
parent
d88188182c
commit
f763a95472
9
index.js
9
index.js
|
@ -460,14 +460,7 @@ xmpp.on("stanza", (stanza) => {
|
||||||
|
|
||||||
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`);
|
||||||
if (!channel.permissionsFor(discord.user).has(Discord.PermissionFlagsBits.SendMessages)) {
|
|
||||||
const logs = await channel.guild.fetchAuditLogs({ type: Discord.AuditLogEvent.BotAdd });
|
|
||||||
const user = logs.entries.find(entry => entry.target.id === discord.user.id)?.executor;
|
|
||||||
if (user) {
|
|
||||||
user.send(`I don't have permission to send messages in the channel ${channel.name} (${channel.id}) in the guild ${channel.guild.name} (${channel.guild.id}). Please update my permissions.`);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// fetch the product text
|
// fetch the product text
|
||||||
trySend = () => {
|
trySend = () => {
|
||||||
fetch(`https://mesonet.agron.iastate.edu/api/1/nwstext/${product_id_raw}`).then((res) => {
|
fetch(`https://mesonet.agron.iastate.edu/api/1/nwstext/${product_id_raw}`).then((res) => {
|
||||||
|
|
Loading…
Reference in a new issue