Vice City: Multiplayer

Community Projects => SLC's Squirrel Plugin => Topic started by: Luckshya on March 3rd, 2019, 03:09 PM

Title: [MODULE] Discord module for SqMod
Post by: Luckshya on March 3rd, 2019, 03:09 PM
Introduction
I was working on this Discord plugin since many days but I've completed the plugin for SqMod now.
The plugin won't be available for official Squirrel plugin because it is missing some very important things like some plugin commands and squirrel API functions that developers failed to provide.
Though, I have modified the squirrel plugin and made some changes and added some missing necessary things required plugins but still something is wrong with code or I don't know that makes it produce some weird errors.
For official squirrel plugin, I can provide with a simple single bot plugin.

This plugin is a multi-bot plugin.

This plugin basically has 2 versions that binds with

It is up to you to decide whether you want to use the sleepydiscord one or libdiscord one.

Documentation
The plugin doesn't really require any such sort of documentation. So, the example code would do the work.

Functions:

Example Usage:
Code: [Select]
local matches = Regex_Match("regex string", "value string"); // returns a bool

Code: [Select]
discordHandle.SetActivity("a game");

//Playing a game



Source

Plugin Source (Sleepy-Discord) : https://github.com/Luckshya/SqMod-Discord1
Plugin Source (libdiscord) : https://github.com/Luckshya/SqMod-Discord

Installation/Requirements

Sleepy-Discord

Windows
Install OpenSSL from here: https://slproweb.com/products/Win32OpenSSL.html
Don't change any options while installing openssl.

Binaries: https://github.com/Luckshya/SqMod-Discord1/releases

Linux
Code: [Select]
apt-get install libssl-dev

Binaries: https://github.com/Luckshya/SqMod-Discord1/releases
(32 bit not available for now)

libdiscord

Windows
Binaries: https://github.com/Luckshya/SqMod-Discord/releases
(Dependencies included)

Linux
Code: [Select]
apt-get install libcpprest-dev

Binaries: https://github.com/Luckshya/SqMod-Discord/releases
(32 bit not available for now)

The most important thing:
Credits

NOTE: You need to take care of the Discord rate limit yourself.
Title: Re: [MODULE] Discord module for SqMod
Post by: Doom_Kill3R on March 3rd, 2019, 04:04 PM
There has been alot of effort put into this, one way or the other, great job!
Title: Re: [MODULE] Discord module for SqMod
Post by: Luckshya on March 4th, 2019, 07:13 AM
Sleepy-Discord Binaries are available now!
Title: Re: [MODULE] Discord module for SqMod
Post by: Luckshya on March 5th, 2019, 11:36 AM
Added function Regex_Match to check for special character/symbols for discord. More details in the main post.
Title: Re: [MODULE] Discord module for SqMod
Post by: Luckshya on March 5th, 2019, 02:51 PM
Fixed issue that crashes the server while closing. Make sure you update the binaries from the latest release on the repo.
Title: Re: [MODULE] Discord module for SqMod
Post by: Luckshya on March 6th, 2019, 08:53 AM
A new update 0.2 has been released that brings the following changes.

Make sure you update the binaries from the latest release on the repo.
Title: Re: [MODULE] Discord module for SqMod
Post by: Luckshya on March 7th, 2019, 04:24 PM
Update v0.2.1 changelog.

Example scripts have been updated.
Make sure you get the latest binaries from the latest release on the repo.
Title: Re: [MODULE] Discord module for SqMod
Post by: Luckshya on March 9th, 2019, 11:40 AM
Update v0.2.2 changelog.

NOTE: libdiscord users should not send empty messages or the message like "" or "\n" or "msg\n" or the server will crash. Support for it may be released in the next version.
Valid message can be: "\nmessage", "msg1\nmsg2"