(Discordia)如何让机器人编辑自己的特定消息?
(Discordia) How to make bot edit to its own specific message?
所以我让我的机器人使用变量发送消息:local text1 = message:reply("Text")
,
但似乎无法找到有关如何编辑消息变量的一些答案。我什至尝试使用 text1:edit("New Text")
但似乎没有用,任何有 Discordia 经验的人都会帮助你知道如何让机器人编辑它自己的消息吗?这是我的机器人代码:
local discordia = require('discordia')
local client = discordia.Client()
local token = "BOT TOKEN"
client:on('messageCreate', function(message)
if message.content == "hello" then
local text1 = message:reply("Text")
text1:edit("This message has been editted!")
end
client:run("Bot "..token)
text1:setContent("This message has been edited!")
或
text1:update{content = "This message has been edited!"}
应该可以。
根据 wiki 和 Discordia;
用于更新消息对象的内容 'text1' 应该是
text1:setContent("This is a new content")
所以我让我的机器人使用变量发送消息:local text1 = message:reply("Text")
,
但似乎无法找到有关如何编辑消息变量的一些答案。我什至尝试使用 text1:edit("New Text")
但似乎没有用,任何有 Discordia 经验的人都会帮助你知道如何让机器人编辑它自己的消息吗?这是我的机器人代码:
local discordia = require('discordia')
local client = discordia.Client()
local token = "BOT TOKEN"
client:on('messageCreate', function(message)
if message.content == "hello" then
local text1 = message:reply("Text")
text1:edit("This message has been editted!")
end
client:run("Bot "..token)
text1:setContent("This message has been edited!")
或
text1:update{content = "This message has been edited!"}
应该可以。
根据 wiki 和 Discordia; 用于更新消息对象的内容 'text1' 应该是
text1:setContent("This is a new content")