Discord integration for Gamecraft
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MenuPresenceHandler.cs 884B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using GamecraftModdingAPI.Events;
  7. using Svelto.ECS;
  8. namespace GamecraftRPC.Events
  9. {
  10. class MenuPresenceHandler : SimpleEventHandlerEngine
  11. {
  12. public static readonly string HandlerName = "GamecraftRPCMenuPresenceEventHandler";
  13. //private Discord.Discord discordRPC = null;
  14. public static void OnAdd(Discord.Discord discordRPC)
  15. {
  16. Plugin.SetDiscordActivity(discordRPC, state: "On menu screen", details: "", start: (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds);
  17. }
  18. public MenuPresenceHandler(Discord.Discord _discordRPC) : base((db) => { OnAdd(_discordRPC); }, (db) => { }, EventType.Menu, HandlerName)
  19. {
  20. //this.discordRPC = _discordRPC;
  21. }
  22. }
  23. }