示例#1
0
 private void Start()
 {
     // Create a new discord setup
     discord = new Discord.Discord(ClientID, (System.UInt64)Discord.CreateFlags.NoRequireDiscord);
     // Set the activity manager
     activityManager = discord.GetActivityManager();
     // Invoke activity updates
     InvokeRepeating("UpdateActivity", 0.0f, 5.0f);
 }
    public void Start()
    {
        const long ClientID = 682703198330421250;

        thisDiscord     = new Discord.Discord(ClientID, (System.UInt64)Discord.CreateFlags.Default);
        userManager     = thisDiscord.GetUserManager();
        activityManager = thisDiscord.GetActivityManager();
        appManager      = thisDiscord.GetApplicationManager();

        UpdateActivity();
    }
        public DiscordLobbyManager(DiscordIntegrationClient integrationClient)
        {
            _connectedLobbies  = new Dictionary <long, DiscordLobby>();
            _integrationClient = integrationClient;
            var client = _integrationClient._discordClient;

            _lobbyManager    = client.GetLobbyManager();
            _activityManager = client.GetActivityManager();

            _lobbyManager.OnNetworkMessage += OnNetworkMessage;
            _lobbyManager.OnLobbyMessage   += OnLobbyMessage;
            _lobbyManager.OnLobbyUpdate    += OnLobbyUpdate;

            _lobbyManager.OnMemberConnect    += OnMemberConnect;
            _lobbyManager.OnMemberDisconnect += OnMemberDisconnect;
            _lobbyManager.OnMemberUpdate     += OnMemberUpdate;
        }
示例#4
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        //GetTree().SetAutoAcceptQuit(false);
        rng = new Random();
        const long CLIENT_ID = 499069912048992271;

        discord_instance = new Discord.Discord(CLIENT_ID, (System.UInt64)Discord.CreateFlags.Default);
        userManager      = discord_instance.GetUserManager();
        activityManager  = discord_instance.GetActivityManager();
        appManager       = discord_instance.GetApplicationManager();

        appManager.GetOAuth2Token((Discord.Result result, ref Discord.OAuth2Token oauth2Token) =>
        {
            GD.Print(result);
            GD.Print('"' + oauth2Token.AccessToken + '"');
            accessToken = oauth2Token.AccessToken;
        });
        UpdateActivity();
    }
示例#5
0
    void Awake()
    {
        if (alreadyRunning)
        {
            Destroy(this);
            return;
        }
        alreadyRunning = true;

        discord         = new Discord.Discord(600379630427570226, (System.UInt64)Discord.CreateFlags.Default);
        activityManager = discord.GetActivityManager();
        Discord.Activity activity = new Discord.Activity
        {
            Details = "Main Menu",
            Assets  =
            {
                LargeImage = "icon",
                LargeText  = "Mein cooles Logo",
            },
        };
        activityManager.UpdateActivity(activity, (res) => { });

        DontDestroyOnLoad(this);
    }
示例#6
0
 void GetActivity()
 {
     discord         = new Discord.Discord(671023511539810305, (System.UInt64)Discord.CreateFlags.Default);
     activityManager = discord.GetActivityManager();
 }
示例#7
0
 void Start()
 {
     _discord         = new Discord.Discord(CLIENT_ID, (UInt64)Discord.CreateFlags.Default);
     _discordActivity = _discord.GetActivityManager();
     UpdateActivity(GetDefaultActivity());
 }
示例#8
0
 private void Start()
 {
     discord         = new Discord.Discord(834754357056634880, (UInt64)Discord.CreateFlags.Default);
     activityManager = discord.GetActivityManager();
     UpdatePresence();
 }