Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Latest commit

 

History

History
39 lines (35 loc) · 942 Bytes

README.md

File metadata and controls

39 lines (35 loc) · 942 Bytes


Example

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 {}
    }
}