public static void Initialize() { Presence = new RichPresence { Details = "In Main Menu", Assets = new Assets { LargeImageText = "Aerovelence", LargeImageKey = "aerodefault", SmallImageKey = "helditem" }, State = "" }; if (Main.netMode != NetmodeID.SinglePlayer) { Presence.Party = new Party { Size = Main.ActivePlayersCount, Max = Main.maxNetPlayers } } ; Client = new DiscordRpcClient("828361668646928466"); Presence.Timestamps = new Timestamps { Start = DateTime.UtcNow }; Client?.Initialize(); Client?.SetPresence(Presence); }
private void InitRichPresence() { if (!this.Enabled) { return; } try { startTime = GameService.GameIntegration.Gw2Process.StartTime.ToUniversalTime(); } catch (Exception ex) { GameService.Debug.WriteWarningLine("Could not establish GW2 start time. Using 'now'."); startTime = DateTime.Now; } rpcClient = new DiscordRpcClient(DISCORD_APP_ID); rpcClient.Initialize(); UpdateDetails(); }
public void load() { client = new DiscordRpcClient(client_id) { SkipIdenticalPresence = true, }; client.OnReady += onReady; client.OnError += Client_OnError; client.OnConnectionFailed += (_, __) => { client.Deinitialize(); System.Windows.MessageBox.Show("Клиент был отключен: " + __.FailedPipe); }; client.Initialize(); }
public static void Init() { client.RegisterUriScheme(); var logFile = Path.Combine(AppDataDir, "discord-rpc.log"); //MessageBox.Show(logFile); //Set the logger. This way we can see the output of the client. //We can set it this way, but doing it directly in the constructor allows for the Register Uri Scheme to be logged too. System.IO.File.WriteAllBytes(logFile, new byte[0]); client.Logger = new FileLogger(logFile, DiscordLogLevel); //Register to the events we care about. We are registering to everyone just to show off the events client.OnReady += OnReady; //Called when the client is ready to send presences client.OnClose += OnClose; //Called when connection to discord is lost client.OnError += OnError; //Called when discord has a error client.OnConnectionEstablished += OnConnectionEstablished; //Called when a pipe connection is made, but not ready client.OnConnectionFailed += OnConnectionFailed; //Called when a pipe connection failed. client.OnPresenceUpdate += OnPresenceUpdate; //Called when the presence is updated client.OnSubscribe += OnSubscribe; //Called when a event is subscribed too client.OnUnsubscribe += OnUnsubscribe; //Called when a event is unsubscribed from. client.OnJoin += OnJoin; //Called when the client wishes to join someone else. Requires RegisterUriScheme to be called. client.OnSpectate += OnSpectate; //Called when the client wishes to spectate someone else. Requires RegisterUriScheme to be called. client.OnJoinRequested += OnJoinRequested; //Called when someone else has requested to join this client. presence.Secrets = new Secrets() { //These secrets should contain enough data for external clients to be able to know which // game to connect too. A simple approach would be just to use IP address, but this is highly discouraged // and can leave your players vulnerable! JoinSecret = "", SpectateSecret = "" }; client.SetPresence(presence); //Initialize the connection. This must be called ONLY once. //It must be called before any updates are sent or received from the discord client. client.Initialize(); isRunning = true; }
static void BasicExample() { // == Create the client var client = new DiscordRpcClient("606102103232086036") { Logger = new DiscordRPC.Logging.ConsoleLogger() }; // == Subscribe to some events client.OnReady += (sender, msg) => { //Create some events so we know things are happening Console.WriteLine("Connected to discord with user {0}", msg.User.Username); }; client.OnPresenceUpdate += (sender, msg) => { //The presence has updated Console.WriteLine("Presence has been updated! "); }; // == Initialize client.Initialize(); // == Set the presence Console.WriteLine(client.ApplicationID); client.SetPresence(new RichPresence() { Details = "Abgefuckt", State = "Diese scheiß API...", Assets = new Assets() { SmallImageText = "", LargeImageKey = "janneslogofinish", LargeImageText = "Was glotzt du so?", SmallImageKey = "gl0_-_dead" } }); Console.ReadKey(); // == At the very end we need to dispose of it client.Dispose(); }
void Initialize() { /* * Create a Discord client * NOTE: If you are using Unity3D, you must use the full constructor and define * the pipe connection. */ client = new DiscordRpcClient("754478844618211328"); //Set the logger client.Logger = new ConsoleLogger() { Level = LogLevel.Warning }; //Subscribe to events client.OnReady += (sender, e) => { Console.WriteLine("Received Ready from user {0}", e.User.Username); }; client.OnPresenceUpdate += (sender, e) => { Console.WriteLine("Received Update! {0}", e.Presence); }; //Connect to the RPC client.Initialize(); //Set the rich presence //Call this as many times as you want and anywhere in your code. client.SetPresence(new RichPresence() { Details = "Just Vibing", Assets = new Assets() { LargeImageKey = "image_large", LargeImageText = "Lachee's Discord IPC Library", SmallImageKey = "image_small" } }); }
private void rpc() { // Discord rpc initilaze if (Properties.Settings.Default.langtr == true) { System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileVersionInfo versionInf = FileVersionInfo.GetVersionInfo(assembly.Location); client = new DiscordRpcClient("814773064671690762"); client.Initialize(); client.SetPresence(new RichPresence() { Details = $"v. {versionInf.FileVersion}", State = "Ana Menüde", Timestamps = Timestamps.Now, Assets = new Assets() { LargeImageKey = "launcher", LargeImageText = $"345 Launcher v. {versionInf.FileVersion}", } }); } else { System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileVersionInfo versionInf = FileVersionInfo.GetVersionInfo(assembly.Location); client = new DiscordRpcClient("814773064671690762"); client.Initialize(); client.SetPresence(new RichPresence() { Details = $"v. {versionInf.FileVersion}", State = "Main Screen", Timestamps = Timestamps.Now, Assets = new Assets() { LargeImageKey = "launcher", LargeImageText = $"345 Launcher v. {versionInf.FileVersion}", } }); } }
private void Initialize() { client = new DiscordRpcClient("645517082431062016") { Logger = new ConsoleLogger() { Level = LogLevel.Warning } }; //Subscribe to events client.OnReady += (sender, e) => { //Console.WriteLine("Received Ready from user {0}", e.User.Username); }; client.OnPresenceUpdate += (sender, e) => { //Console.WriteLine("Received Update! {0}", e.Presence); }; //Connect to the RPC client?.Initialize(); //Set the rich presence //Call this as many times as you want and anywhere in your code. client?.SetPresence(new RichPresence() { Details = "Nostale PServer", State = "Ancelloan", Assets = new Assets() { LargeImageKey = "ancelloan", LargeImageText = "Ancelloan.eu" } }); var timer = new System.Timers.Timer(150); timer.Elapsed += (sender, args) => { client?.Invoke(); }; timer.Start(); }
public Form1() { InitializeComponent(); LoadTimeSchedule(); client = new DiscordRpcClient("709092892525985842"); client.Logger = new ConsoleLogger() { Level = LogLevel.Warning }; client.OnReady += (sender, e) => { Console.WriteLine("Received Ready from user {0}", e.User.Username); }; client.OnPresenceUpdate += (sender, e) => { Console.WriteLine("Received Update! {0}", e.Presence); }; client.Initialize(); }
private void Main() { GetSavedPath(); IsValorantRunning(); GetClientApiCredentials(); GetUserData(); NewLog("getting valorant data from " + this.userData.game_name + "#" + this.userData.game_tag + " ..."); GetValorantData(); NewLog("valorant data from " + this.userData.game_name + "#" + this.userData.game_tag + " were detected!"); Thread isValorantStillRunningThread = new Thread(new ThreadStart(IsValorantStillRunning)); isValorantStillRunningThread.IsBackground = true; isValorantStillRunningThread.Start(); drpc = new DiscordRpcClient("825736299583504435"); drpc.Initialize(); Thread updateThread = new Thread(new ThreadStart(ValorantDataUpdate)); updateThread.IsBackground = true; updateThread.Start(); }
public void StartRichPresence() { client = new DiscordRpcClient("537710248664760322"); client.Initialize(); client.SetPresence(new RichPresence() { Details = "Idle", //State = "Idle", Assets = new Assets() { LargeImageKey = "cd-logo", LargeImageText = "Cyber Discovery", SmallImageKey = "cd-logo" } }); var timer = new System.Timers.Timer(150); timer.Elapsed += (sender, args) => { UpdateFromURL(); }; timer.Start(); }
public DiscordRPCService(IPlaybackService playbackService) { PlaybackService = playbackService; PlaybackService.PlaybackSuccess += OnPlaybackStarted; PlaybackService.PlaybackResumed += OnPlaybackResumed; PlaybackService.PlaybackPaused += OnPlaybackPaused; PlaybackService.PlaybackStopped += OnPlaybackStopped; RpcClient = new DiscordRpcClient("592217166770864138"); RpcClient.Initialize(); RpcClient.SetPresence(new RichPresence()); Presence.Assets = new Assets(); RpcClient.OnReady += (send, s) => Console.WriteLine("Received Ready from user {0}", s.User.Username); RpcClient.OnPresenceUpdate += (send, s) => Console.WriteLine("Received Update! {0}", s.Presence); RpcClient.Logger = new ConsoleLogger() { Level = LogLevel.Warning }; }
void Initialize() { //Initialize Client client = new DiscordRpcClient("459809227339202570"); //Logger client.Logger = new ConsoleLogger() { Level = LogLevel.Warning }; client.OnReady += (sender, e) => { Console.WriteLine("Received Ready from user {0}", e.User.Username); }; client.OnPresenceUpdate += (sender, e) => { Console.WriteLine("Received Update from user {0}", e.Presence); }; client.Initialize(); }
public static void SetupRichPresence() { rpcClient = new DiscordRpcClient("795015105061847111"); #if DEBUG rpcClient.Logger = new ConsoleLogger(LogLevel.Error); #endif rpcClient.Initialize(); UpdateRichPresence(); foreach (EntityViewModel entityViewModel in ServerManager.Instance.Entities) { entityViewModel.PropertyChanged += (sender, args) => { if (args.PropertyName != null && args.PropertyName.Equals(nameof(entityViewModel.CurrentStatus))) { UpdateRichPresence(); } }; } }
protected override void OnStart(string[] args) { if (has_connection_to_internet() && has_discord_running()) { for (int i = 0; i < args.Length; i++) { switch (args[i]) { case "-pipe": discord_pipe = int.Parse(args[++i]); break; default: break; } } set_presence(); update_totaltime.Start(); client.Initialize(); } }
public void StartRPC() { string details = "Roblox Executor"; string state = "Open-Sourced"; string largeimagetext = "Made by ArilisDev"; client = new DiscordRpcClient("683151267996106807"); client.Initialize(); client.SetPresence(new RichPresence() { Details = details, State = state, Assets = new Assets() { LargeImageKey = "circle", LargeImageText = largeimagetext } }); }
public void InitializeDiscordRPC(string ClientID) { #if DEBUG Debug.WriteLine(TAG + "Starting Discord Presence"); #else #endif Application.Current.Dispatcher.Invoke(delegate { Window mainWindow = Application.Current.MainWindow; mainWindow.DataContext = mainViewModel; }); client = new DiscordRpcClient(ClientID); client.Initialize(); mainViewModel.discordConnectionStatusViewModel.Status = "Starting Discord Presence...."; client.OnReady += OnClientReady; client.OnConnectionFailed += OnConnectionFailed; client.OnConnectionEstablished += OnConnectionEstablished; }
public void InitDiscordPresence() { client = new DiscordRpcClient(DISCORD_PRESENCE_CLIENT_ID, false, -1); presence = new RichPresence() { Assets = new Assets() { LargeImageKey = Settings.Get <StreamType>(Setting.StreamType) == StreamType.Jpop ? "jpop" : "kpop", LargeImageText = "LISTEN.moe", SmallImageKey = "play", }, Timestamps = new Timestamps() { Start = DateTime.UtcNow } }; client.Initialize(); }
void InGame() { client = new DiscordRpcClient("803726762445242458"); client.Initialize(); client.Invoke(); client.SetPresence(new RichPresence() { Details = "", State = "Playing Minecraft", Timestamps = Timestamps.Now, Assets = new Assets() { LargeImageKey = "life", LargeImageText = "Dev Mode", SmallImageKey = "image_small" } });; }
//client = new DiscordRpcClient("737629176819089418"); public void Initialize() { /* * Create a discord client * NOTE: If you are using Unity3D, you must use the full constructor and define * the pipe connection. */ client = new DiscordRpcClient("737629176819089418"); //Set the logger //client.Logger = new ConsoleLogger() { Level = LogLevel.Warning }; //Subscribe to events client.OnReady += (sender, e) => { Console.WriteLine("Received Ready from user {0}", e.User.Username); }; client.OnPresenceUpdate += (sender, e) => { Console.WriteLine("Received Update! {0}", e.Presence); }; //Connect to the RPC client.Initialize(); //Set the rich presence //Call this as many times as you want and anywhere in your code. client.SetPresence(new RichPresence() { Details = "Play Jackbox Games within our app!", State = "Availiable on GitHub!", Assets = new Assets() { LargeImageKey = "rpciconbgno", LargeImageText = "Box", SmallImageKey = "tv", SmallImageText = "jackbox.tv" } }); }
private void ThisAddIn_Startup(object sender, System.EventArgs e) { client = new DiscordRpcClient(Shared.Shared.getString("discordID")); client.Initialize(); client.SetPresence(presence); // An event handler for when a new slide is created this.Application.PresentationNewSlide += new PowerPoint.EApplication_PresentationNewSlideEventHandler( Application_PresentationNewSlide); // An event handler for any time a slide / slides / inbetween slides is selected this.Application.SlideSelectionChanged += new PowerPoint.EApplication_SlideSelectionChangedEventHandler( Application_SlideSelectionChanged); // An event handler for when a file is closed. // Final = Actually closed this.Application.PresentationCloseFinal += new PowerPoint.EApplication_PresentationCloseFinalEventHandler( Application_PresentationCloseFinal); // Event handlers for when a file is created, opened, saved, or slide show ends. this.Application.AfterNewPresentation += new PowerPoint.EApplication_AfterNewPresentationEventHandler( Application_AfterPresentationOpenEvent); this.Application.AfterPresentationOpen += new PowerPoint.EApplication_AfterPresentationOpenEventHandler( Application_AfterPresentationOpenEvent); this.Application.PresentationSave += new PowerPoint.EApplication_PresentationSaveEventHandler( Application_AfterPresentationOpenEvent); this.Application.SlideShowEnd += new PowerPoint.EApplication_SlideShowEndEventHandler( Application_AfterPresentationOpenEvent); // An event handler for when a slide show starts, or goes onto a new slide this.Application.SlideShowNextSlide += new PowerPoint.EApplication_SlideShowNextSlideEventHandler( Application_SlideShowNextSlide); }
private static void Main() { // If you see this text, that means your .NET Framework installation is not screwed up... Writeline("ScrewndereDev V1.1 - Now with stolen boxart!"); Writeline("Initializing..."); // Initialize a new RPC Client. DiscordRpcClient discord = new DiscordRpcClient(DISCORD_CLIENT_ID); // Define Callbacks. discord.OnReady += (sender, e) => Writeline(string.Format("Received Ready from user: {0}#{1}", e.User.Username, e.User.Discriminator)); discord.OnPresenceUpdate += (sender, e) => Writeline(string.Format("Received new presence: {0}" + Environment.NewLine + "Now go type -verifyme", e.Presence.State)); discord.OnRpcMessage += (sender, e) => Writeline(string.Format("Recieved RPC call: {0}", e.Type.ToString())); discord.OnJoinRequested += (sender, e) => Writeline(string.Format("Join request: {0}#{1}", e.User.Username, e.User.Discriminator)); discord.OnError += (sender, e) => Writeline(string.Format("Error: {0}", e.Message)); discord.OnSubscribe += (sender, e) => Writeline(string.Format("OnSubscribe: {0} : {1}", e.Event.ToString(), e.Type.ToString())); discord.OnConnectionEstablished += (sender, e) => Writeline(string.Format("Connection established (Pipe Ind): {0}", e.ConnectedPipe.ToString())); // Actually ask the library to do something (and print initialization's result). Writeline("Initialize() result: " + (discord.Initialize() ? "OK! :)" : "Error! :(")); // Bypass the check discord.SetPresence (new RichPresence() { State = PRESENCE_STATUS, Details = PRESENCE_DETAILS, Assets = new Assets() { LargeImageKey = PRESENCE_LKEY, LargeImageText = PRESENCE_LDESC } } ); // And then we loop forever processing Discord's requests. while (true) { discord.Invoke(); } }
static void BasicExample() { //Create a new client var client = new DiscordRpcClient(ClientID); //Create the logger client.Logger = new Logging.ConsoleLogger() { Level = DiscordLogLevel, Coloured = true }; //Create some events so we know things are happening client.OnReady += (sender, msg) => { Console.WriteLine("Connected to discord with user {0}", msg.User.Username); }; client.OnPresenceUpdate += (sender, msg) => { Console.WriteLine("Presence has been updated!"); }; //Create a timer that will regularly call invoke var timer = new System.Timers.Timer(150); timer.Elapsed += (sender, evt) => { client.Invoke(); }; timer.Start(); //Connect client.Initialize(); //Send a presence. Do this as many times as you want client.SetPresence(new RichPresence() { Details = "A Basic Example", State = "In Game", Timestamps = Timestamps.FromTimeSpan(10) }); //Do the rest of your program. //Simulated by a Console.ReadKey Console.ReadKey(); //At the very end we need to dispose of it timer.Dispose(); client.Dispose(); }
public void Enable(bool enable) { if (!IsEnabled && enable) { //Subscribe to events _discClient.OnReady += (sender, e) => { Console.WriteLine("Received Ready from user {0}", e.User.Username); }; _discClient.OnPresenceUpdate += (sender, e) => { Console.WriteLine("Received Update! {0}", e.Presence); }; //Connect to the RPC _discClient.Initialize(); _presence = new RichPresence() { Details = "Horsify 2.0", State = "Playing", Assets = new Assets() { LargeImageKey = "small", LargeImageText = "Horsify 2.0", } }; //Set the rich presence //Call this as many times as you want and anywhere in your code. _discClient.SetPresence(_presence); IsEnabled = true; } else { _discClient.OnReady -= null; _discClient.OnPresenceUpdate -= null; IsEnabled = false; } }
public PluginInfo Initialise(IntPtr apiInterfacePtr) { _mbApiInterface = new MusicBeeApiInterface(); _mbApiInterface.Initialise(apiInterfacePtr); _about.PluginInfoVersion = PluginInfoVersion; _about.Name = "DiscordBee"; _about.Description = "Update your Discord Profile with the currently playing track"; _about.Author = "Stefan Lengauer"; _about.TargetApplication = ""; // current only applies to artwork, lyrics or instant messenger name that appears in the provider drop down selector or target Instant Messenger _about.Type = PluginType.General; _about.VersionMajor = 1; // your plugin version _about.VersionMinor = 4; _about.Revision = 2; _about.MinInterfaceVersion = MinInterfaceVersion; _about.MinApiRevision = MinApiRevision; _about.ReceiveNotifications = (ReceiveNotificationFlags.PlayerEvents | ReceiveNotificationFlags.TagEvents); _about.ConfigurationPanelHeight = 0; // height in pixels that musicbee should reserve in a panel for config settings. When set, a handle to an empty panel will be passed to the Configure function var settingsFilePath = _mbApiInterface.Setting_GetPersistentStoragePath() + _about.Name + "\\" + _about.Name + ".settings"; _settings = Settings.GetInstance(settingsFilePath); _settingsWindow = new SettingsWindow(this, _settings); _discordClient = new DiscordRpcClient("409394531948298250"); _discordClient.OnError += ErrorCallback; _discordClient.OnClose += DisconnectedCallback; _discordClient.SkipIdenticalPresence = true; _discordClient.Logger = new DebugLogger(LogLevel.Trace); _discordClient.Initialize(); _discordPresence.Assets = new Assets(); _discordPresence.Party = new Party(); _discordPresence.Timestamps = new Timestamps(); // Match least number of chars possible but min 1 _layoutHandler = new LayoutHandler(new Regex("\\[(.+?)\\]")); Debug.WriteLine(_about.Name + " loaded"); return(_about); }
/// <summary> /// Initializes the RPC client. /// </summary> public static void Initialize(string clientID) { _client = new DiscordRpcClient(clientID) { Logger = new ConsoleLogger() { Level = LogLevel.Warning } }; _client.OnReady += OnReady; _client.OnClose += OnClose; _client.OnError += OnError; _client.OnConnectionEstablished += OnConnectionEstablished; _client.OnConnectionFailed += OnConnectionFailed; _client.OnPresenceUpdate += OnPresenceUpdate; _client.Initialize(); RichPresenceHelper.IsInitialized = true; }
private void discordRPC() { string clientIdPath0 = Application.StartupPath + "\\Tools\\discord_clientid.txt"; client = new DiscordRpcClient(File.ReadAllText(clientIdPath0)); client.Logger = new ConsoleLogger() { Level = LogLevel.Warning }; client.Initialize(); client.SetPresence(new RichPresence() { State = "Taking Screenshots", Timestamps = Timestamps.Now, Assets = new Assets() { LargeImageKey = "image_large", LargeImageText = "XeShare", } }); }
void Initialize() { /* * Create a discord client * NOTE: If you are using Unity3D, you must use the full constructor and define * the pipe connection as DiscordRPC.IO.NativeNamedPipeClient */ client = new DiscordRpcClient("545493713779163147"); //Subscribe to events client.OnReady += (sender, e) => { Console.WriteLine("Received Ready from user {0}", e.User.Username); }; client.OnPresenceUpdate += (sender, e) => { }; client.Initialize(); }
private void initClient() { client = new DiscordRpcClient("711923739188527124"); if (client.Initialize()) { if (VRCTrackingManager.Method_Public_Static_Boolean_11()) { presence = VRpresence; } else { presence = DesktopPresence; } client.SetPresence(presence); IceLogger.Log("DiscordRPC Initialised!"); } else { IceLogger.Error("DiscordRPC Initialise Error!"); } }
public static void StartDiscordRPC() { try { client = new DiscordRpcClient("804551416793530389"); client.Initialize(); client.SetPresence(new RichPresence { Details = "made by tragedy", Timestamps = Timestamps.Now, Assets = new Assets { LargeImageKey = "1", LargeImageText = "Made By tragedy", } });; } catch { } }