Making a bot with discordia/lit/luvit that can kick people

187 Views Asked by At

I'm really new to scripting so I wanted my first script to be a discord bot. But I don't know how to make one. Here is the script:

Also i might need some basics about lua shouldn't i?

local discordia = require('discordia')
local coro = require("coro-http")
local client = discordia.Client()

--hi
client:on('messageCreate', function(message)
    local content = message.content
    local member = message.member
    local memberid = message.member.id
    if content:lower() == 'hi' then
        message:reply('Hello there!')
    end
end)

--hello
client:on('messageCreate', function(message)
    local content = message.content
    local member = message.member
    local memberid = message.member.id
    if content:lower() == 'hello' then
        message:reply('Hello there!')
    end
end)

--bye
client:on('messageCreate', function(message)
    local content = message.content
    local member = message.member
    local memberid = message.member.id
    if content:lower() == 'bye' then
        message:reply('Goodbye!')
    end
end)


--goodbye
client:on('messageCreate', function(message)
    local content = message.content
    local member = message.member
    local memberid = message.member.id
    if content:lower() == 'goodbye' then
        message:reply('Goodbye!')
    end
end)


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

I have tried everything i could have done, seriously. It feels so weird to get to actual lua from Roblox Lua

1

There are 1 best solutions below

0
MegaPiggy On

You can do it like this.

member:kick("Spamming")