Skip to content

Connect to discord (sorta) using GS2

Notifications You must be signed in to change notification settings

imkirko/discord-gs2

Repository files navigation

discord-gs2

Connect to discord (sorta) using GS2

First create the client

  this.bot  = new TDiscord("Bot");
  Bot.debug = true;
  Bot.login(TOKEN);

Then do stuff with it

  temp.embed = TDiscord.newRichEmbed()
  .setTitle(getServerName())
  .setDescription("Some info here")
  .setURL("http://www.someSite.com")
  .addField("Playercount", allplayers.size())
  .addField("CPU", getprocesscpuusage() * 100)
  .setAuthor("NPC-Server", "http://www.somesite.com", "https://cdn.discordapp.com/embed/avatars/0.png");

  temp.channel = Bot.guilds.find("id", "69696969").createChannel("server-" @ getServerName() , "text");
  temp.channel.sendEmbed("Hello discord!", temp.embed);

Also,

You can connect to a webhook easily

  this.client = new TWebhookClient();
  this.client.connect(idOrUrl, token); // token not needed if using url
  this.client.sendMessage("This is a webhook");

About

Connect to discord (sorta) using GS2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages