Bot will now show in the console when it joins or leaves a server
This commit is contained in:
		@@ -317,9 +317,23 @@ namespace NadekoBot
 | 
			
		||||
            Client.Ready += SetClientReady;
 | 
			
		||||
            await clientReady.Task.ConfigureAwait(false);
 | 
			
		||||
            Client.Ready -= SetClientReady;
 | 
			
		||||
            Client.JoinedGuild += Client_JoinedGuild;
 | 
			
		||||
            Client.LeftGuild += Client_LeftGuild;
 | 
			
		||||
            _log.Info("Shard {0} logged in.", ShardId);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private Task Client_LeftGuild(SocketGuild arg)
 | 
			
		||||
        {
 | 
			
		||||
            _log.Info("Left server: {0} [{1}]", arg?.Name, arg?.Id);
 | 
			
		||||
            return Task.CompletedTask;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private Task Client_JoinedGuild(SocketGuild arg)
 | 
			
		||||
        {
 | 
			
		||||
            _log.Info("Joined server: {0} [{1}]", arg?.Name, arg?.Id);
 | 
			
		||||
            return Task.CompletedTask;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public async Task RunAsync(params string[] args)
 | 
			
		||||
        {
 | 
			
		||||
            if(ShardId == 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ namespace NadekoBot.Services
 | 
			
		||||
        int TotalShards { get; }
 | 
			
		||||
        string ShardRunCommand { get; }
 | 
			
		||||
        string ShardRunArguments { get; }
 | 
			
		||||
        string PatreonCampaignId { get; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class DBConfig
 | 
			
		||||
 
 | 
			
		||||
@@ -36,6 +36,8 @@ namespace NadekoBot.Services.Impl
 | 
			
		||||
        public string ShardRunArguments { get; }
 | 
			
		||||
        public int ShardRunPort { get; }
 | 
			
		||||
 | 
			
		||||
        public string PatreonCampaignId { get; }
 | 
			
		||||
 | 
			
		||||
        public BotCredentials()
 | 
			
		||||
        {
 | 
			
		||||
            _log = LogManager.GetCurrentClassLogger();
 | 
			
		||||
@@ -64,6 +66,7 @@ namespace NadekoBot.Services.Impl
 | 
			
		||||
                MashapeKey = data[nameof(MashapeKey)];
 | 
			
		||||
                OsuApiKey = data[nameof(OsuApiKey)];
 | 
			
		||||
                PatreonAccessToken = data[nameof(PatreonAccessToken)];
 | 
			
		||||
                PatreonCampaignId = data[nameof(PatreonCampaignId)] ?? "334038";
 | 
			
		||||
                ShardRunCommand = data[nameof(ShardRunCommand)];
 | 
			
		||||
                ShardRunArguments = data[nameof(ShardRunArguments)];
 | 
			
		||||
                if (string.IsNullOrWhiteSpace(ShardRunCommand))
 | 
			
		||||
@@ -121,6 +124,7 @@ namespace NadekoBot.Services.Impl
 | 
			
		||||
            public DBConfig Db { get; set; } = new DBConfig("sqlite", "Filename=./data/NadekoBot.db");
 | 
			
		||||
            public int TotalShards { get; set; } = 1;
 | 
			
		||||
            public string PatreonAccessToken { get; set; } = "";
 | 
			
		||||
            public string PatreonCampaignId { get; set; } = "334038";
 | 
			
		||||
 | 
			
		||||
            public string ShardRunCommand { get; set; } = "";
 | 
			
		||||
            public string ShardRunArguments { get; set; } = "";
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@ namespace NadekoBot.Services.Utility
 | 
			
		||||
                        {
 | 
			
		||||
                            Links = new PatreonDataLinks()
 | 
			
		||||
                            {
 | 
			
		||||
                                next = "https://api.patreon.com/oauth2/api/campaigns/334038/pledges"
 | 
			
		||||
                                next = $"https://api.patreon.com/oauth2/api/campaigns/{_creds.PatreonCampaignId}/pledges"
 | 
			
		||||
                            }
 | 
			
		||||
                        };
 | 
			
		||||
                        do
 | 
			
		||||
 
 | 
			
		||||
@@ -16,6 +16,7 @@
 | 
			
		||||
  },
 | 
			
		||||
  "TotalShards": 1,
 | 
			
		||||
  "PatreonAccessToken": "",
 | 
			
		||||
  "PatreonCampaignId": "334038",
 | 
			
		||||
  "ShardRunCommand": "",
 | 
			
		||||
  "ShardRunArguments": "",
 | 
			
		||||
  "ShardRunPort": null
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user