Sign In Register

How can we help you today?

Start a new topic

Discord Integration

discord.js makes things SO EASY for .... anything and everything. There's all-too-many fun things you could do with their API:


https://discord.js.org


Check it out :)


1 person likes this idea

Hi Dylan,


What is it specifically you would want to achieve with the Discord integration in relation to GameSparks ? 


Regards,

Liam

I just noticed this reply: Discord auth -- then return essential information, much like your Steam auth (similar as in, it doesn't return an email, but does return tokens with useful info). Some native Discord features would allow us to do Discord bot stuff within the use of a 3rd-party API.


For example, we have a Discord bot that gets a webhook from in-game when people are starting games and a result of when they are finished. The data bounces all over the place, but if I could do that directly GS, that'd be way easier to manipulate data meant for Discord.



image


image


If they can login via Discord, this means that we can instantly get their Discord information if it's connected.


Examples:

https://github.com/dylanh724/tol-node-public/blob/master/tol2/routes/discord.js


var msg = "Hello from " + Spark.getPlayerId();

channel.send(msg).then(message =>

{

    // Success

})

or


var discordHandle = Spark.Discord().handle;


or


var myServerId = "asdf123";

var guilds = Spark.Discord().guilds; // []

var isInMyServer = guilds.indexOf(myServerId) !== -1;

Login to post a comment