%shardid% %shardcount% and %shardguilds% added to .ropl
This commit is contained in:
		 Submodule Discord.Net updated: 58766448d7...7c0cce6d35
									
								
							@@ -1,5 +1,6 @@
 | 
				
			|||||||
using Discord;
 | 
					using Discord;
 | 
				
			||||||
using Discord.Commands;
 | 
					using Discord.Commands;
 | 
				
			||||||
 | 
					using Discord.WebSocket;
 | 
				
			||||||
using NadekoBot.Attributes;
 | 
					using NadekoBot.Attributes;
 | 
				
			||||||
using NadekoBot.Extensions;
 | 
					using NadekoBot.Extensions;
 | 
				
			||||||
using NadekoBot.Services;
 | 
					using NadekoBot.Services;
 | 
				
			||||||
@@ -50,7 +51,16 @@ namespace NadekoBot.Modules.Administration
 | 
				
			|||||||
                                if (string.IsNullOrWhiteSpace(status))
 | 
					                                if (string.IsNullOrWhiteSpace(status))
 | 
				
			||||||
                                    continue;
 | 
					                                    continue;
 | 
				
			||||||
                                PlayingPlaceholders.ForEach(e => status = status.Replace(e.Key, e.Value()));
 | 
					                                PlayingPlaceholders.ForEach(e => status = status.Replace(e.Key, e.Value()));
 | 
				
			||||||
                                await NadekoBot.Client.SetGameAsync(status).ConfigureAwait(false);
 | 
					                                var shards = NadekoBot.Client.Shards;
 | 
				
			||||||
 | 
					                                for (int i = 0; i < shards.Count; i++)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    ShardSpecificPlaceholders.ForEach(e => status = status.Replace(e.Key, e.Value(shards.ElementAt(i))));
 | 
				
			||||||
 | 
					                                    try { await shards.ElementAt(i).SetGameAsync(status).ConfigureAwait(false); }
 | 
				
			||||||
 | 
					                                    catch (Exception ex)
 | 
				
			||||||
 | 
					                                    {
 | 
				
			||||||
 | 
					                                        _log.Warn(ex);
 | 
				
			||||||
 | 
					                                    }
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        catch (Exception ex)
 | 
					                        catch (Exception ex)
 | 
				
			||||||
@@ -82,7 +92,14 @@ namespace NadekoBot.Modules.Administration
 | 
				
			|||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    { "%queued%", () => Music.Music.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count).ToString()},
 | 
					                    { "%queued%", () => Music.Music.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count).ToString()},
 | 
				
			||||||
                    { "%time%", () => DateTime.Now.ToString("hh:mm " + TimeZoneInfo.Local.StandardName.GetInitials()) }
 | 
					                    { "%time%", () => DateTime.Now.ToString("hh:mm " + TimeZoneInfo.Local.StandardName.GetInitials()) },
 | 
				
			||||||
 | 
					                    { "%shardcount%", () => NadekoBot.Client.Shards.Count.ToString() },
 | 
				
			||||||
 | 
					                };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            public static Dictionary<string, Func<DiscordSocketClient, string>> ShardSpecificPlaceholders { get; } =
 | 
				
			||||||
 | 
					                new Dictionary<string, Func<DiscordSocketClient, string>> {
 | 
				
			||||||
 | 
					                    { "%shardid%", (client) => client.ShardId.ToString()},
 | 
				
			||||||
 | 
					                    { "%shardguilds%", (client) => client.Guilds.Count.ToString()},
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            [NadekoCommand, Usage, Description, Aliases]
 | 
					            [NadekoCommand, Usage, Description, Aliases]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5118,7 +5118,7 @@ namespace NadekoBot.Resources {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        ///    Looks up a localized string similar to Spend a unit of currency to plant it in this channel. (If bot is restarted or crashes, the currency will be lost).
 | 
					        ///    Looks up a localized string similar to Spend an amount of currency to plant it in this channel. Default is 1. (If bot is restarted or crashes, the currency will be lost).
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public static string plant_desc {
 | 
					        public static string plant_desc {
 | 
				
			||||||
            get {
 | 
					            get {
 | 
				
			||||||
@@ -5127,7 +5127,7 @@ namespace NadekoBot.Resources {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        ///    Looks up a localized string similar to `{0}plant`.
 | 
					        ///    Looks up a localized string similar to `{0}plant` or `{0}plant 5`.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public static string plant_usage {
 | 
					        public static string plant_usage {
 | 
				
			||||||
            get {
 | 
					            get {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1372,10 +1372,11 @@
 | 
				
			|||||||
    <value>plant</value>
 | 
					    <value>plant</value>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="plant_desc" xml:space="preserve">
 | 
					  <data name="plant_desc" xml:space="preserve">
 | 
				
			||||||
    <value>Spend a unit of currency to plant it in this channel. (If bot is restarted or crashes, the currency will be lost)</value>
 | 
					    <value>Spend an amount of currency to plant it in this channel. Default is 1. (If bot is restarted or crashes, the currency will be lost)</value>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="plant_usage" xml:space="preserve">
 | 
					  <data name="plant_usage" xml:space="preserve">
 | 
				
			||||||
    <value>`{0}plant`</value>
 | 
					    <value>`{0}plant` or `{0}plant 5`</value>
 | 
				
			||||||
 | 
					    <comment> </comment>
 | 
				
			||||||
  </data>
 | 
					  </data>
 | 
				
			||||||
  <data name="gencurrency_cmd" xml:space="preserve">
 | 
					  <data name="gencurrency_cmd" xml:space="preserve">
 | 
				
			||||||
    <value>gencurrency gc</value>
 | 
					    <value>gencurrency gc</value>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user