Unable to get all Webhooks - Permissions?

Would I be correct, in saying even if a Bot has setup a Webhook to the News Channel of a Server it is Admin of (Bot Server), that if the bot loses scope over the connected Channel, that the Webhook is effectively invisible to the Bot?
19 Replies
Unknown User
Unknown Userβ€’3y ago
Message Not Public
Sign In & Join Server To View
Yinoguns
YinogunsOPβ€’3y ago
v14.3.0 I am using:
const guildWebhooks = await guild.fetchWebhooks();
const guildWebhooks = await guild.fetchWebhooks();
Yinoguns
YinogunsOPβ€’3y ago
And even though my Bot is in the Source-Server, and can see the news channel
Yinoguns
YinogunsOPβ€’3y ago
The webhook that connects this channel to one of my "client servers" shall we say, does not appear in guildWebhooks
Yinoguns
YinogunsOPβ€’3y ago
User of Client Server has confirmed they are getting these Alerts
Yinoguns
YinogunsOPβ€’3y ago
So it seems I effectivly have no scope over who is listening to my channels, even though Bot is in their server Bot has basics, so view of some but not all channels, and manage webhooks Would channel partials help? all I need is the Id; or to just know they have one setup I don't mind that they have one, I just want to know if they do So the system of my bot is only I am in the server where this NewsChannel is, and only the Bot gives other Servers a way to subscribe Not with invites disabled, who said it bas to be public?
Yinoguns
YinogunsOPβ€’3y ago
So this is super odd, I just added a webhook with my bot, rebooted the bot, and it can still identify the webhook for the channel it has no access to πŸ€”
Yinoguns
YinogunsOPβ€’3y ago
Yet as someone else showed me, they get my alerts even though the /getWebhooksForBot says there is none πŸ€”
Yinoguns
YinogunsOPβ€’3y ago
No mention of channel-defined perms πŸ€”
Yinoguns
YinogunsOPβ€’3y ago
I believe I have identified the initial problem, my Bot lacks Permissions in some form to the Channel. It can't fetch the channel, but it does have it in the cache πŸ€”
Yinoguns
YinogunsOPβ€’3y ago
Cache.get
Yinoguns
YinogunsOPβ€’3y ago
Yinoguns
YinogunsOPβ€’3y ago
Yup, full bot spin-down and re-boot and it's back in the cache Wait what
Yinoguns
YinogunsOPβ€’3y ago
Yinoguns
YinogunsOPβ€’3y ago
Nope no adding You can see the code I ran, literally post-boot Yup got that My Bot doesn't do anything more exotic, I don't manipulate the cache, literally at all Lawful Good, I don't touch the special stuff ok other than force fetching, but isn't that ok to do? ah, are you thinking the force fetch, forces the channel into the cache? I'll reboot the bot shortly then do a get of the guild, and return the channels
Yinoguns
YinogunsOPβ€’3y ago
@qjuh Fresh boot, and did Get Guild -> Get Channel and same result:
Yinoguns
YinogunsOPβ€’3y ago
What did you mean by an APIChannel, as in the Raw API data, instead of the one DJS builds? ah yes, apologies, to turn it into a file, I use JSON.stringify Not a bad idea, I'll make the change
res from Eval <ref *2> TextChannel {
type: 0,
// guild: <ref *1> Guild {...}, // removed due to size of object
guildId: '925072158093344849',
parentId: '925542181924634787',
permissionOverwrites: PermissionOverwriteManager { channel: [Circular *2] },
messages: MessageManager { channel: [Circular *2] },
threads: ThreadManager { channel: [Circular *2] },
nsfw: false,
id: '946083925955063828',
name: 'γ€ŒπŸ’»γ€admin',
rawPosition: 14,
topic: null,
lastMessageId: '1041084320753922139',
lastPinTimestamp: 1648514803000,
rateLimitPerUser: 0
}
res from Eval <ref *2> TextChannel {
type: 0,
// guild: <ref *1> Guild {...}, // removed due to size of object
guildId: '925072158093344849',
parentId: '925542181924634787',
permissionOverwrites: PermissionOverwriteManager { channel: [Circular *2] },
messages: MessageManager { channel: [Circular *2] },
threads: ThreadManager { channel: [Circular *2] },
nsfw: false,
id: '946083925955063828',
name: 'γ€ŒπŸ’»γ€admin',
rawPosition: 14,
topic: null,
lastMessageId: '1041084320753922139',
lastPinTimestamp: 1648514803000,
rateLimitPerUser: 0
}
Can do
res from Eval <ref *1> PermissionOverwriteManager {
channel: <ref *2> TextChannel {
type: 0,
// guild: Guild {...},
guildId: '925072158093344849',
parentId: '925542181924634787',
permissionOverwrites: [Circular *1],
messages: MessageManager { channel: [Circular *2] },
threads: ThreadManager { channel: [Circular *2] },
nsfw: false,
id: '946083925955063828',
name: 'γ€ŒπŸ’»γ€admin',
rawPosition: 14,
topic: null,
lastMessageId: '1041084320753922139',
lastPinTimestamp: 1648514803000,
rateLimitPerUser: 0
}
}
res from Eval <ref *1> PermissionOverwriteManager {
channel: <ref *2> TextChannel {
type: 0,
// guild: Guild {...},
guildId: '925072158093344849',
parentId: '925542181924634787',
permissionOverwrites: [Circular *1],
messages: MessageManager { channel: [Circular *2] },
threads: ThreadManager { channel: [Circular *2] },
nsfw: false,
id: '946083925955063828',
name: 'γ€ŒπŸ’»γ€admin',
rawPosition: 14,
topic: null,
lastMessageId: '1041084320753922139',
lastPinTimestamp: 1648514803000,
rateLimitPerUser: 0
}
}
Looks like it has no properties, other than channel?
res from Eval <ref *1> PermissionOverwriteManager {
channel: <ref *2> TextChannel {...}
}
res from Eval <ref *1> PermissionOverwriteManager {
channel: <ref *2> TextChannel {...}
}
Those are from console logs @qjuh I've copied the above from my logs app
Yinoguns
YinogunsOPβ€’3y ago
Yinoguns
YinogunsOPβ€’3y ago
let guild = client.guilds.cache.get('925072158093344849'); // ubge
res = guild.channels.cache.get('946083925955063828').permissionOverwrites; // admin
let guild = client.guilds.cache.get('925072158093344849'); // ubge
res = guild.channels.cache.get('946083925955063828').permissionOverwrites; // admin
oh sorry, work today has been crap
res from Eval Collection(10) [Map] {
'925896409662759013' => PermissionOverwrites {
id: '925896409662759013',
type: 0,
deny: PermissionsBitField { bitfield: 1024n },
allow: PermissionsBitField { bitfield: 1093941066577n }
},
'704094762990567535' => PermissionOverwrites {
id: '704094762990567535',
type: 1,
deny: PermissionsBitField { bitfield: 0n },
allow: PermissionsBitField { bitfield: 2147863616n }
},
'929911456953167963' => PermissionOverwrites {
id: '929911456953167963',
type: 0,
deny: PermissionsBitField { bitfield: 131801822224n },
allow: PermissionsBitField { bitfield: 962139245377n }
},
'938844904778510356' => PermissionOverwrites {
id: '938844904778510356',
type: 0,
deny: PermissionsBitField { bitfield: 638607963408n },
allow: PermissionsBitField { bitfield: 446743169601n }
},
'938842771308027955' => PermissionOverwrites {
id: '938842771308027955',
type: 0,
deny: PermissionsBitField { bitfield: 26575114512n },
allow: PermissionsBitField { bitfield: 517610139201n }
},
'948744514955280384' => PermissionOverwrites {
id: '948744514955280384',
type: 1,
deny: PermissionsBitField { bitfield: 0n },
allow: PermissionsBitField { bitfield: 380104993856n }
},
'938845675305713664' => PermissionOverwrites {
id: '938845675305713664',
type: 0,
deny: PermissionsBitField { bitfield: 97442080016n },
allow: PermissionsBitField { bitfield: 996498987585n }
},
'958168427636342889' => PermissionOverwrites {
id: '958168427636342889',
type: 0,
deny: PermissionsBitField { bitfield: 0n },
allow: PermissionsBitField { bitfield: 2147863616n }
},
'938845365002719274' => PermissionOverwrites {
id: '938845365002719274',
type: 0,
deny: PermissionsBitField { bitfield: 630018028816n },
allow: PermissionsBitField { bitfield: 463923038785n }
},
res from Eval Collection(10) [Map] {
'925896409662759013' => PermissionOverwrites {
id: '925896409662759013',
type: 0,
deny: PermissionsBitField { bitfield: 1024n },
allow: PermissionsBitField { bitfield: 1093941066577n }
},
'704094762990567535' => PermissionOverwrites {
id: '704094762990567535',
type: 1,
deny: PermissionsBitField { bitfield: 0n },
allow: PermissionsBitField { bitfield: 2147863616n }
},
'929911456953167963' => PermissionOverwrites {
id: '929911456953167963',
type: 0,
deny: PermissionsBitField { bitfield: 131801822224n },
allow: PermissionsBitField { bitfield: 962139245377n }
},
'938844904778510356' => PermissionOverwrites {
id: '938844904778510356',
type: 0,
deny: PermissionsBitField { bitfield: 638607963408n },
allow: PermissionsBitField { bitfield: 446743169601n }
},
'938842771308027955' => PermissionOverwrites {
id: '938842771308027955',
type: 0,
deny: PermissionsBitField { bitfield: 26575114512n },
allow: PermissionsBitField { bitfield: 517610139201n }
},
'948744514955280384' => PermissionOverwrites {
id: '948744514955280384',
type: 1,
deny: PermissionsBitField { bitfield: 0n },
allow: PermissionsBitField { bitfield: 380104993856n }
},
'938845675305713664' => PermissionOverwrites {
id: '938845675305713664',
type: 0,
deny: PermissionsBitField { bitfield: 97442080016n },
allow: PermissionsBitField { bitfield: 996498987585n }
},
'958168427636342889' => PermissionOverwrites {
id: '958168427636342889',
type: 0,
deny: PermissionsBitField { bitfield: 0n },
allow: PermissionsBitField { bitfield: 2147863616n }
},
'938845365002719274' => PermissionOverwrites {
id: '938845365002719274',
type: 0,
deny: PermissionsBitField { bitfield: 630018028816n },
allow: PermissionsBitField { bitfield: 463923038785n }
},
'925072158093344849' => PermissionOverwrites {
id: '925072158093344849',
type: 0,
deny: PermissionsBitField { bitfield: 1091757604177n },
allow: PermissionsBitField { bitfield: 2425344n }
}
}
'925072158093344849' => PermissionOverwrites {
id: '925072158093344849',
type: 0,
deny: PermissionsBitField { bitfield: 1091757604177n },
allow: PermissionsBitField { bitfield: 2425344n }
}
}
There we go I'm logging off for the night, hope your evening is good Will be around somewhat So this is my bot's role in that server, neither the id or the tags.botId exist in the overwrites.
{
"guild": "925072158093344849",
"icon": null,
"unicodeEmoji": null,
"id": "955492727334793219",
"name": "foxhole-bot-yinoguns",
"color": 0,
"hoist": false,
"rawPosition": 51,
"permissions": "536930368",
"managed": true,
"mentionable": false,
"tags": {
"botId": "939617098932580372"
},
"createdTimestamp": 1647877618393
}
{
"guild": "925072158093344849",
"icon": null,
"unicodeEmoji": null,
"id": "955492727334793219",
"name": "foxhole-bot-yinoguns",
"color": 0,
"hoist": false,
"rawPosition": 51,
"permissions": "536930368",
"managed": true,
"mentionable": false,
"tags": {
"botId": "939617098932580372"
},
"createdTimestamp": 1647877618393
}
So I can only assume my Bot has literally Zero access to the channel πŸ€” Thanks Discord πŸ‘ So I guess we've found 2 things: 1) Discord does provide data on channels the bot cannot see 2) If bot lacks perms to a channel, then it cannot detect webhooks for it even though it has Manage Webhooks
Want results from more Discord servers?
Add your server