This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Table to hold our Discord CSessions | |
sessions <- {}; | |
// Wrapper class to manage our session | |
class CDiscord | |
{ | |
session = null; | |
connID = null; | |
channels = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//open connection to discord | |
discordConn <- Discord_Open("token here"); | |
//event onDiscord_Ready indicating that the bot has connected successfully | |
function onDiscord_Ready(discordHandle) { | |
//retrieve our connection ID | |
local connID = Discord_ConnID(discordHandle); | |
print("Discord bot at ID: " + connID + " is ready."); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//open connection to discord | |
discordConn <- Discord_Open("token here"); | |
//event onDiscord_Ready indicating that the bot has connected successfully | |
function onDiscord_Ready(discordHandle) { | |
//retrieve our connection ID | |
local connID = Discord_ConnID(discordHandle); | |
print("Discord bot at ID: " + connID + " is ready."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyDiscord extends SqDiscord.Session | |
{ | |
function constructor() { | |
// Call the base constructor to intialize the connection | |
base.constructor(); | |
// Bind our events | |
base.Bind(SqDiscordEvent.Ready, this, onReady); | |
base.Bind(SqDiscordEvent.Message, this, onMessage); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyDiscord extends SqDiscord.Session | |
{ | |
function constructor() { | |
// Call the base constructor to intialize the connection | |
base.constructor(); | |
// Bind our events | |
base.Bind(SqDiscordEvent.Ready, this, onReady); | |
base.Bind(SqDiscordEvent.Message, this, onMessage); | |
base.Bind(SqDiscordEvent.GuildLoaded, this, onLoaded); |