Luckshya

  • Full Member
  • Posts: 110
Re: Discord Plugin
« Reply #30,  »Last edited
Update v0.4.4 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)
  • Switched to a single event onDiscordUpdate for all events with variable no. of arguments (see wiki)
  • 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 EventType, 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-squirrel/wiki
Release: https://github.com/Luckshya/sleepydiscord-squirrel/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.

EDIT: New release has been deleted for some reason, will be available back soon.
EDIT #2: Releases have been re-uploaded, make sure you get the latest one again.

Anish87

  • Newbie
  • Posts: 9
Re: Discord Plugin
« Reply #31,  »Last edited
Nice! :)
Major update, really useful. Can you further explain the onDiscordUpdate though?

Razor.

  • Jr. Member
  • Posts: 79
Re: Discord Plugin
« Reply #32,  »Last edited
I think it would be a type of event callback used in Discord. Try:
Code: [Select]
function onDiscordUpdate(connID, eventType, ...)
{
switch(eventType)
{
case SqDiscordEvent.Message:
print( "lol" );
break;
}
}
If i'm wrong, correct me.

Anish87

  • Newbie
  • Posts: 9
Re: Discord Plugin
« Reply #33,  »
Quote from Razor. on July 10th, 08:03 PM
I think it would be a type of event callback used in Discord. Try:
Code: [Select]
function onDiscordUpdate(connID, eventType, ...)
{
switch(eventType)
{
case SqDiscordEvent.Message:
print( "lol" );
break;
}
}
If i'm wrong, correct me.
no you're not wrong. I got in touch with Luckshya after that reply and understood the thing.
Re: Discord Plugin
« Reply #34,  »
I have a suggestion Luckshya... Please add the SetPresence parameter for the bot and AvatarURL for SqDiscord.User.

KrooB

  • Full Member
  • BEN TÜRKÜM
  • Posts: 142
Re: Discord Plugin
« Reply #35,  »Last edited
if we can move player to another channel on discord with this plugin, we are able to make a basic phone call system like moving player and other player (who is calling) to a private voice channel and they speak blah blah.
 am i right ?
We are his people !
Who can challange us ?

DizzasTeR

  • VC:MP Beta Tester
  • Infinite loops defy infinity by overflowing memory
  • Posts: 1,147
Re: Discord Plugin
« Reply #36,  »
Quote from KrooB on August 7th, 11:54 PM
if we can move player to another channel on discord with this plugin, we are able to make a basic phone call system like moving player and other player (who is calling) to a private voice channel and they speak blah blah.
 am i right ?
Yes you can probably do that but they both have to be on discord of your server