mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
fix: fix crash in role_buttons if the role button message is removed and the guild reloaded
This commit is contained in:
parent
123b08c191
commit
8db8b21995
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ export async function applyRoleButtons(
|
||||||
if (existingSavedButtons?.channel_id) {
|
if (existingSavedButtons?.channel_id) {
|
||||||
const existingChannel = await pluginData.guild.channels.fetch(configItem.message.channel_id);
|
const existingChannel = await pluginData.guild.channels.fetch(configItem.message.channel_id);
|
||||||
const existingMessage = await (existingChannel?.isText() &&
|
const existingMessage = await (existingChannel?.isText() &&
|
||||||
existingChannel.messages.fetch(existingSavedButtons.message_id));
|
existingChannel.messages.fetch(existingSavedButtons.message_id).catch(() => null));
|
||||||
if (existingMessage && existingMessage.components.length) {
|
if (existingMessage && existingMessage.components.length) {
|
||||||
await existingMessage.edit({
|
await existingMessage.edit({
|
||||||
components: [],
|
components: [],
|
||||||
|
|
Loading…
Add table
Reference in a new issue