Compiles and runs now \ o /
This commit is contained in:
parent
c446b889c7
commit
1d685757bf
@ -76,6 +76,7 @@ namespace NadekoBot.Modules.Administration
|
||||
[RequirePermission(GuildPermission.ManageRoles)]
|
||||
public async Task Removerole(IMessage imsg, IGuildUser usr, [Remainder] IRole role)
|
||||
{
|
||||
var channel = imsg.Channel as ITextChannel;
|
||||
try
|
||||
{
|
||||
await usr.RemoveRolesAsync(role).ConfigureAwait(false);
|
||||
@ -362,10 +363,10 @@ namespace NadekoBot.Modules.Administration
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequirePermission(GuildPermission.ManageChannels)]
|
||||
public async Task DelVoiChanl(IMessage imsg, [Remainder] IVoiceChannel channel)
|
||||
public async Task DelVoiChanl(IMessage imsg, [Remainder] IVoiceChannel voiceChannel)
|
||||
{
|
||||
await channel.DeleteAsync().ConfigureAwait(false);
|
||||
await channel.SendMessageAsync($"Removed channel **{channel.Name}**.").ConfigureAwait(false);
|
||||
await voiceChannel.DeleteAsync().ConfigureAwait(false);
|
||||
await imsg.Channel.SendMessageAsync($"Removed channel **{voiceChannel.Name}**.").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
|
@ -58,6 +58,7 @@ namespace NadekoBot.Modules.Searches.Commands
|
||||
if (i % 2 == 0 && i != 0)
|
||||
sb.AppendLine();
|
||||
sb.Append($"`{i + 1}.` **{dataList[i]["name"]}** ");
|
||||
//sb.AppendLine($" ({dataList[i]["general"]["banRate"]}%)");
|
||||
}
|
||||
|
||||
await channel.SendMessageAsync(sb.ToString()).ConfigureAwait(false);
|
||||
|
@ -15,13 +15,18 @@ namespace NadekoBot.Modules.Searches.Commands
|
||||
public class PokemonSearchCommands
|
||||
{
|
||||
//todo DB
|
||||
private static Dictionary<string, SearchPokemon> pokemons;
|
||||
private static Dictionary<string, SearchPokemonAbility> pokemonAbilities;
|
||||
private static Dictionary<string, SearchPokemon> pokemons = new Dictionary<string, SearchPokemon>();
|
||||
private static Dictionary<string, SearchPokemonAbility> pokemonAbilities = new Dictionary<string, SearchPokemonAbility>();
|
||||
|
||||
public const string PokemonAbilitiesFile = "data/pokemon/pokemon_abilities.json";
|
||||
|
||||
public const string PokemonListFile = "data/pokemon/pokemon_list.json";
|
||||
|
||||
public PokemonSearchCommands()
|
||||
{
|
||||
pokemons = JsonConvert.DeserializeObject<Dictionary<string, SearchPokemon>>(File.ReadAllText("data/pokemon/pokemon_list.json"));
|
||||
pokemonAbilities = JsonConvert.DeserializeObject<Dictionary<string, SearchPokemonAbility>>(File.ReadAllText("data/pokemon/pokemon_abilities.json"));
|
||||
if(File.Exists(PokemonListFile))
|
||||
pokemons = JsonConvert.DeserializeObject<Dictionary<string, SearchPokemon>>(File.ReadAllText(PokemonListFile));
|
||||
pokemonAbilities = JsonConvert.DeserializeObject<Dictionary<string, SearchPokemonAbility>>(File.ReadAllText(PokemonAbilitiesFile));
|
||||
}
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
|
@ -17,7 +17,7 @@ using NadekoBot.Modules.Searches.Commands.Models;
|
||||
namespace NadekoBot.Modules.Searches
|
||||
{
|
||||
[Module("~", AppendSpace = false)]
|
||||
public class Searches : DiscordModule
|
||||
public partial class Searches : DiscordModule
|
||||
{
|
||||
private IYoutubeService _yt { get; }
|
||||
|
||||
|
@ -26,11 +26,11 @@ namespace NadekoBot.Modules.Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task WhoPlays(IMessage imsg, [Remainder] string game = null)
|
||||
{
|
||||
var chnl = (IGuildChannel)imsg.Channel;
|
||||
var channel = imsg.Channel as ITextChannel;
|
||||
game = game.Trim().ToUpperInvariant();
|
||||
if (string.IsNullOrWhiteSpace(game))
|
||||
return;
|
||||
var arr = (await chnl.Guild.GetUsersAsync())
|
||||
var arr = (await (imsg.Channel as IGuildChannel).Guild.GetUsersAsync())
|
||||
.Where(u => u.Game?.Name?.ToUpperInvariant() == game)
|
||||
.Select(u => u.Username)
|
||||
.ToList();
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key=".Net Core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
Loading…
Reference in New Issue
Block a user