[MODULE] Discord module for SqMod

Started by Luckshya, Mar 03, 2019, 03:09 PM

Previous topic - Next topic

Luckshya

Introduction
Discord module for SqMod using sleepy-discord library.

This plugin is a multi-bot plugin.

Documentation
Wiki: https://github.com/Luckshya/sleepydiscord-sqmod/wiki/
Example code: Available on wiki

Source
Sleepy-Discord: https://github.com/yourWaifu/sleepy-discord
Plugin Source: https://github.com/Luckshya/sleepydiscord-sqmod

Installation/Requirements

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

Binaries: https://github.com/Luckshya/sleepydiscord-sqmod/releases

Linux
apt-get install libssl-dev
Binaries: https://github.com/Luckshya/sleepydiscord-sqmod/releases
(32 bit not available for now)

The most important thing:
Credits
  • @. (SLC): I've learnt a lot from his code and I've also implemented and used his code. He has also helped me throughout the problems including my stupid problems or whatever. He's just like the author of the plugin tbh.
  • @Doom_Kill3R
  • @EK.IceFlake
  • @Sebastian
  • @Xmair

NOTE: You need to take care of the Discord rate limit yourself.

DizzasTeR

#1
There has been alot of effort put into this, one way or the other, great job!

Luckshya

Sleepy-Discord Binaries are available now!

Luckshya

Added function Regex_Match to check for special character/symbols for discord. More details in the main post.

Luckshya

Fixed issue that crashes the server while closing. Make sure you update the binaries from the latest release on the repo.

Luckshya

A new update 0.2 has been released that brings the following changes.
  • Fixed an issue that causes server to crash when a DM is received by the bot.
  • Added param authorID to the event onMessage as updated in the example code.

Make sure you update the binaries from the latest release on the repo.

Luckshya

Update v0.2.1 changelog.
  • Added param authorNick to event onMessage
  • Added function GetRoleName to get the name of role using server ID and role ID
  • Fixed an issue of updating roles and other things in Sleepy-Discord version

Example scripts have been updated.
Make sure you get the latest binaries from the latest release on the repo.

Luckshya

#7
Update v0.2.2 changelog.
  • Added function SetActivity. More information about it in main post.
  • Fixed several bugs

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"

Luckshya

Update v0.4

A lot of bug fixes and features have been added which can be seen on wiki or the repository itself.

New project repository: https://github.com/Luckshya/sleepydiscord-sqmod
Wiki: https://github.com/Luckshya/sleepydiscord-sqmod/wiki
Releases: https://github.com/Luckshya/sleepydiscord-sqmod/releases

Luckshya

Update v0.4.1 changelog :-
  • Added invalid serverID check in GetRoleName function
  • Added EditChannel function

More about the new EditChannel here: https://github.com/Luckshya/sleepydiscord-sqmod/wiki/Session_EditChannel
Latest release: https://github.com/Luckshya/sleepydiscord-sqmod/releases

Luckshya

Update v0.4.2 changelog :-
  • Added onError, onDisconnect, onQuit events.
  • Added ErrorEventHandler option to toggle custom error logger.

More info about the new features added here: https://github.com/Luckshya/sleepydiscord-sqmod/wiki
Latest Release: https://github.com/Luckshya/sleepydiscord-sqmod/releases

Example code on wiki updated!

Luckshya

#11
Update v0.4.3 changelog :-
  • Switched to lock-free queues instead of mutex locks on server thread, so a boost in performance
  • Added an option to toggle internal cache
  • Added cache events (see wiki for more info)
  • Changed message event function parameters
  • Added new script objects to identify discord objects like Guild, Channel, User, ServerMember, Role, Message
  • Added GetGuild and GetOtherChannel functions (more info about them on wiki)
  • Event callbacks are now made through lock free queue
  • Added new constants for Discord ChannelType and MessageType

Wiki has been restructured and newly added features have been added it. Make sure to see the wiki before using them.
Added example code for both internal cache enabled and disabled on wiki.

Wiki: https://github.com/Luckshya/sleepydiscord-sqmod/wiki
Release: https://github.com/Luckshya/sleepydiscord-sqmod/releases/

I recommend to keep the internal cache disabled and manage cache yourself. I have also provided an example script on wiki to cache data.