Discord Bot Framework written in V
[!CAUTION]
I dropped the support of this lib at the end of 2021. The reason is that I don’t care anymore about V, fixing “bugs” around new syntax and catching segfaults from socket interactions is not fun. Feel free to fork and keep alive if you need it.There is another beginning at DarpHome/discord.v, please check them.
import terisback.discordv as vd
fn main() {
mut client := vd.new(token: 'token') ?
client.on_message_create(on_ping)
client.run().wait()
}
fn on_ping(mut client vd.Client, evt &vd.MessageCreate) {
if evt.content == '!ping' {
client.channel_message_send(evt.channel_id, content: 'pong!') or { }
}
}
More examples
discord.v uses openssl, be sure it is installed apt install libssl-dev
Only way to run it on Windows is to use WSL (or install
openssl
headers somehow)
v install Terisback.discordv
git clone https://github.com/Terisback/discord.v.git ~/.vmodules/terisback/discordv
And then import terisback.discordv
wherever you like
multipart/form-data
for file sendingapplication/json
for sending without binary dataFeel free to contribute ;)
You can contact me at discord: TERISBACK#9125