尝试制作踢出和封禁玩家的指令,但是出现了错误

我正在尝试制作一个踢出和封禁玩家的指令,但是在踢出用户的部分出现了一个空值错误。 我不太懂lua,我是在roblox学习的。

我的脚本是:

local client = discordia.Client()

client:on('ready', function()
    print('作为 '.. client.user.username ..' 登录')
end)

client:on('messageCreate', function(message)
  -- Variables _
  local msg = string.lower(message.content)
  local member = message.member
  local author = message.author
  -- Variables ^
    if msg == 'a!ping' then
        message.channel:send('Pong!')
    end
  if msg:sub(1,#'a!kick') == 'a!kick' then
    local mentioned = message.mentionedUsers
    if #mentioned == 1 then
      message.guild:kickuser(mentioned)
    end
  end
end)

client:run('Bot '..io.open("./token.txt"):read())

而错误是:

stack traceback:
        [C]: in function 'assert'
        ...ocuments/Programando/bots-lua/guru/deps/coro-channel.lua:62: in function 'onPlain'
        ...Programando/bots-lua/guru/deps/secure-socket/biowrap.lua:76: in function <...Programando/bots-lua/guru/deps/secure-socket/biowrap.lua:61>
        [C]: in function 'run'
        [string "bundle:/init.lua"]:52: in function <[string "bundle:/init.lua"]:47>
        [C]: in function 'xpcall'
        [string "bundle:/init.lua"]:47: in function 'fn'
        [string "bundle:deps/require.lua"]:310: in function <[string "bundle:deps/require.lua"]:266>```
点赞