.shardid guildid
added, .ropl fixed
This commit is contained in:
parent
58f23ff40b
commit
1e5b7df47f
@ -1 +1 @@
|
||||
Subproject commit 0fd1e70a22612ff9fa697dace96f22780080b01f
|
||||
Subproject commit 9ce5c4757efc6cb6bb8959e851abcdcbe03217be
|
@ -24,7 +24,12 @@ namespace NadekoBot.Modules.Administration
|
||||
public static List<PlayingStatus> RotatingStatusMessages { get; }
|
||||
public static bool RotatingStatuses { get; private set; } = false;
|
||||
private static Timer _t { get; }
|
||||
|
||||
|
||||
private class TimerState
|
||||
{
|
||||
public int Index { get; set; } = 0;
|
||||
}
|
||||
|
||||
static PlayingRotateCommands()
|
||||
{
|
||||
_log = LogManager.GetCurrentClassLogger();
|
||||
@ -34,21 +39,21 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
|
||||
|
||||
_t = new Timer(async (_) =>
|
||||
_t = new Timer(async (objState) =>
|
||||
{
|
||||
var index = 0;
|
||||
try
|
||||
{
|
||||
var state = (TimerState)objState;
|
||||
if (!RotatingStatuses)
|
||||
return;
|
||||
else
|
||||
{
|
||||
if (index >= RotatingStatusMessages.Count)
|
||||
index = 0;
|
||||
if (state.Index >= RotatingStatusMessages.Count)
|
||||
state.Index = 0;
|
||||
|
||||
if (!RotatingStatusMessages.Any())
|
||||
return;
|
||||
var status = RotatingStatusMessages[index++].Status;
|
||||
var status = RotatingStatusMessages[state.Index++].Status;
|
||||
if (string.IsNullOrWhiteSpace(status))
|
||||
return;
|
||||
PlayingPlaceholders.ForEach(e => status = status.Replace(e.Key, e.Value()));
|
||||
@ -68,7 +73,7 @@ namespace NadekoBot.Modules.Administration
|
||||
{
|
||||
_log.Warn("Rotating playing status errored.\n" + ex);
|
||||
}
|
||||
}, null, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1));
|
||||
}, new TimerState(), TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1));
|
||||
}
|
||||
|
||||
public static Dictionary<string, Func<string>> PlayingPlaceholders { get; } =
|
||||
|
@ -301,6 +301,14 @@ namespace NadekoBot.Modules.Utility
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
public async Task ShardId(ulong guildid)
|
||||
{
|
||||
var shardId = NadekoBot.Client.GetShardIdFor(guildid);
|
||||
|
||||
await Context.Channel.SendConfirmAsync($"ShardId for **{guildid}** with {NadekoBot.Client.Shards.Count} total shards", shardId.ToString()).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
public async Task Stats()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user