import vcord
fn main() {
mut conf := vcord.Config{
token: "BOT_TOKEN",
intents: vcord.all_intents
}
mut bot := vcord.new(mut &conf) ?
bot.on("ready", on_ready)
bot.on("message_create", on_message)
bot.login() ?
}
fn on_ready(mut bot &vcord.Bot, mut event &vcord.Ready) {
println("Ready")
}
fn on_message(mut bot &vcord.Bot, mut message &vcord.Message){
if message.content == '!ping' {
bot.create_message(message.channel_id, vcord.MessagePayload{
content: 'Pong!',
embeds: [
vcord.MessageEmbed{
title: 'Hello World',
color: 0x7289da,
description: 'This is a test'
}
]
}) or {}
}
}
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.