This commit is contained in:
Master Kwoth
2017-09-10 23:01:26 +02:00
parent 2ab4274c22
commit 771e0df064
4 changed files with 9 additions and 32 deletions

View File

@ -409,19 +409,6 @@ namespace NadekoBot.Modules.Administration
await ReplyConfirmLocalized("message_sent").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[OwnerOnly]
public async Task Announce([Remainder] string message)
{
var channels = _client.Guilds.Select(g => g.DefaultChannel).ToArray();
if (channels == null)
return;
await Task.WhenAll(channels.Where(c => c != null).Select(c => c.SendConfirmAsync(GetText("message_from_bo", Context.User.ToString()), message)))
.ConfigureAwait(false);
await ReplyConfirmLocalized("message_sent").ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[OwnerOnly]
public async Task ReloadImages()

View File

@ -31,19 +31,18 @@ namespace NadekoBot.Modules.Utility
{
var channel = (ITextChannel)Context.Channel;
guildName = guildName?.ToUpperInvariant();
IGuild guild;
SocketGuild guild;
if (string.IsNullOrWhiteSpace(guildName))
guild = channel.Guild;
guild = (SocketGuild)channel.Guild;
else
guild = _client.Guilds.FirstOrDefault(g => g.Name.ToUpperInvariant() == guildName.ToUpperInvariant());
if (guild == null)
return;
var ownername = await guild.GetUserAsync(guild.OwnerId);
var textchn = (await guild.GetTextChannelsAsync()).Count();
var voicechn = (await guild.GetVoiceChannelsAsync()).Count();
var ownername = guild.GetUser(guild.OwnerId);
var textchn = guild.TextChannels.Count();
var voicechn = guild.VoiceChannels.Count();
var createdAt = new DateTime(2015, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(guild.Id >> 22);
var users = await guild.GetUsersAsync().ConfigureAwait(false);
var features = string.Join("\n", guild.Features);
if (string.IsNullOrWhiteSpace(features))
features = "-";
@ -52,7 +51,7 @@ namespace NadekoBot.Modules.Utility
.WithTitle(guild.Name)
.AddField(fb => fb.WithName(GetText("id")).WithValue(guild.Id.ToString()).WithIsInline(true))
.AddField(fb => fb.WithName(GetText("owner")).WithValue(ownername.ToString()).WithIsInline(true))
.AddField(fb => fb.WithName(GetText("members")).WithValue(users.Count.ToString()).WithIsInline(true))
.AddField(fb => fb.WithName(GetText("members")).WithValue(guild.MemberCount.ToString()).WithIsInline(true))
.AddField(fb => fb.WithName(GetText("text_channels")).WithValue(textchn.ToString()).WithIsInline(true))
.AddField(fb => fb.WithName(GetText("voice_channels")).WithValue(voicechn.ToString()).WithIsInline(true))
.AddField(fb => fb.WithName(GetText("created_at")).WithValue($"{createdAt:dd.MM.yyyy HH:mm}").WithIsInline(true))

View File

@ -774,15 +774,6 @@
<data name="donadd_usage" xml:space="preserve">
<value>`{0}donadd Donate Amount`</value>
</data>
<data name="announce_cmd" xml:space="preserve">
<value>announce</value>
</data>
<data name="announce_desc" xml:space="preserve">
<value>Sends a message to all servers' default channel that bot is connected to.</value>
</data>
<data name="announce_usage" xml:space="preserve">
<value>`{0}announce Useless spam`</value>
</data>
<data name="savechat_cmd" xml:space="preserve">
<value>savechat</value>
</data>