[英]I am making a discord bot, but I get this weird error.. how should I fix this?
票務系統.js :const { Client, MessageEmbed, MessageActionRow, MessageButton, Modal, TextInputComponent, } = require("discord.js" ...
[英]I am making a discord bot, but I get this weird error.. how should I fix this?
票務系統.js :const { Client, MessageEmbed, MessageActionRow, MessageButton, Modal, TextInputComponent, } = require("discord.js" ...
[英]MongoDB findOneAndDelete() will not delete the specified query-- I can't quite figure out why?
我正在嘗試編寫一個 Discord.JS 機器人,它使用 MongoDB 的 Model 和架構功能列出和刪除特定的頻道/線程。 我已經弄清楚了其他所有內容,實際的消息刪除、頻道刪除以及刪除 function 所需的所有其他內容,但出於某種原因提示 MongoDB 使用指定的 ID 刪除 Chat ...
[英]Discord.js error : TypeError: Cannot read properties of undefined (reading 'options')
我有這段代碼可以解除對使用 id 的人的封禁(順便說一句,如果你知道如何通過“ping”一個被封禁的用戶來解除封禁,我想知道該怎么做)。 我的 id 有問題,可能是一個字母,我的代碼崩潰了,所以我嘗試修復它,但我知道問題是該選項未定義。 這是我的代碼: 錯誤是: 類型錯誤:無法讀取未定義的屬性(讀 ...
[英]How to create a function to send messages
我有一個node.js應用程序,我創建了一個 discord 機器人來與之交互。 我希望這樣,如果我的node.js應用程序發生特定事件,它會向我的 discord 服務器中的特定頻道發送消息。 這是我第一次使用discord.js 。 但是,我的想法是創建一個 function,我可以調用它來發送 ...
[英]How can i edit button label 0 to 1 when pressed button on Discord.JS v14
當按下 Discord.JS v14 上的按鈕時,如何將按鈕 label 0 編輯為 1 此代碼無效我將此代碼 V13 轉換為 v14 但沒有用。 我該如何解決? 看指南,但我不明白 ...
[英]WebStorm - discord.js - "Element is not exported"
出於某種原因,我和其他許多人都遇到過 WebStorm 和 Discord.js 的問題,特別是它無法識別 package 中的某些(重新)導出的模塊; 在這種情況下,來自 Builders 的人似乎是有問題的人: 然而,正如 discord.js@14.7.1 所建議的那樣,我沒有安裝 Bui ...
[英]How can i make my .setFooter so if i dont specific footer text/img args its just null?
如何使 my.setFooter 與我嵌入的 rest 相同? 要做到這一點,如果我沒有特定的頁腳文本/img 參數,它只是 null? 這是我當前的代碼,其他一切都按照我的設置方式工作,但我不確定如何為.setFooter 執行此操作。 ...
[英]Edit variables with command discord.js v13
我正在開發一個 discord.js v13 機器人,我想創建一個命令來添加通道 ID,該命令在現有變量中執行,另一個命令僅適用於變量中的通道這是變量 與存儲的頻道一起使用的命令 編輯:我在命令中使用了 array.push() 但它沒有用它什么也沒做 編輯 2:它有效,但在重新啟動后會重置 ...
[英]Discord.js V14 how to edit an embed already sent?
我在做一個假贈品系統,我需要用“贈品結束”嵌入消息示例編輯“贈品開始”嵌入消息我找不到解決方案 ...
[英]how to check if the elements of an array from an array of arrays is included in another array
我創建了這個 function includesArray ,它只在直接獲勝時起作用(圖像 1和圖像 2是它的移動日志),但是當它是像圖像 3這樣的情況時(圖像 4是它的移動日志),它失敗了. 我能做些什么來解決它?//win moves const winMoves = [ //horizon ...
[英]Collector doesn't end with reason time
如果在時間用完后沒有人得到正確答案,我會得到這個混亂的單詞代碼。 但收藏家並沒有以某種方式結束。 該代碼工作正常,但我希望收集器在給定的有限時間內結束。 這是代碼:const listword = ['array', 'of', 'words']; var word = listword[Math ...
[英]Discord.js V14 / Embed doesn't send after restarting bot
短篇故事: 我用/setup-blacklistlog設置日志通道然后我將用戶 A列入黑名單然后讓用戶 A加入服務器並且代碼向我發送一個嵌入它檢測到黑名單用戶的原因但是在我重新啟動之后讓用戶再次加入有沒有發送嵌入,當我再次嘗試設置頻道時,它沒有說:“這已經存在。” (當然這並沒有在實際代碼中實現。 ...
[英]Problem with creating a text channel in a acategory and some specific permissions
我的代碼有一個小問題,在給定的操作中,必須在服務器管理員、調用命令的用戶和命令中標記的用戶訪問的類別中創建一個文本通道。 一切正常我設法創建頻道我什至可以將它添加到正確的類別但我無法更改其權限。 我嘗試了多種方法包括: updateOverwrite createOverwrite overwrit ...
[英]How do I make a Selection Menu that collects users from a server in discord.js
我想從服務器(Bot Style Nekotina#0608)為 select 用戶制作一個菜單,以在 userinfo 命令中實現,但我不知道該怎么做,你能幫我嗎? 在此處輸入圖像描述我嘗試了正常的 ActionRow 方式,但我希望它看起來像上圖...... ...
[英]Discord.js : Trying to export client from ./index.js, but it keeps saying client is undefined
我目前正在使用 node.js 編寫一個 discord 機器人,我想創建一個向特定用戶發送 dm 的命令,但我無法將我的客戶端變量放入所需的文件中。 這是我在 index.js 中的代碼 ...
[英]How to make the bot reply with multiple action rows in DiscordJS?
我正在嘗試使用 DiscordJS 制作一個 Discord 機器人,它可以玩 TicTacToe 游戲,但我不知道如何在機器人回復下方添加 3 行按鈕。 我已經制作了 3 個按鈕行: 這是機器人的回復(只有 1 行)。 回復應在消息下方有 3 行。 ...
[英]Discord.js when you're writing a slash command file is it possible to return a value from it?
可能是一個愚蠢的問題,但你能從 discord.js 中的斜杠命令文件中返回一個值來表示隊列之類的東西嗎? 我試過查看文檔,但找不到任何相關內容。 ...
[英]How do I send an embed with buttons to a specific channel in discord.js?
因此,我正在嘗試將嵌入發送到特定頻道 ( 1068005047373414481 ),並且我想使用ActionRow組件發送帶有某種新按鈕的嵌入。 請記住,該頻道與運行交互的頻道不同。 無論如何,我已經嘗試使用interaction.guild.channels.cache.get(id).sen ...
[英]Error when trying to add or set a permission with ApplicationCommandPermissionsManager
當我在行會中創建斜杠命令后嘗試設置它的權限時,我不斷收到401: Unauthorized 。 我使用 ApplicationCommandManager 創建斜杠命令(它可以工作並且沒有問題)。 創建后,我嘗試為該斜杠命令設置權限,它一直給我401: Unauthorized 。 我很困惑,因為我 ...
[英]How can I show every voice channel ID/name of a guild with DiscordJS?
我正在嘗試獲取並顯示公會的所有語音頻道名稱。 那是我的代碼,不起作用client.on('ready', () => { client.channels.fetch().then(channel => { console.log(channel.nam ...