changed !m to !!, and there is no space now. This won't apply to people with old configuration.json

This commit is contained in:
Kwoth 2016-07-19 18:27:16 +02:00
parent 33f8dc87d3
commit 60bc7d4f71
3 changed files with 64 additions and 64 deletions

View File

@ -31,16 +31,16 @@ namespace NadekoBot.Modules.Music
{ {
var client = NadekoBot.Client; var client = NadekoBot.Client;
manager.CreateCommands(Prefix, cgb => manager.CreateCommands("", cgb =>
{ {
cgb.AddCheck(PermissionChecker.Instance); cgb.AddCheck(PermissionChecker.Instance);
commands.ForEach(cmd => cmd.Init(cgb)); commands.ForEach(cmd => cmd.Init(cgb));
cgb.CreateCommand("next") cgb.CreateCommand(Prefix + "next")
.Alias("n") .Alias(Prefix + "n")
.Alias("skip") .Alias(Prefix + "skip")
.Description("Goes to the next song in the queue. You have to be in the same voice channel as the bot. | `!m n`") .Description("Goes to the next song in the queue. You have to be in the same voice channel as the bot. | `!m n`")
.Do(e => .Do(e =>
{ {
@ -50,8 +50,8 @@ namespace NadekoBot.Modules.Music
musicPlayer.Next(); musicPlayer.Next();
}); });
cgb.CreateCommand("stop") cgb.CreateCommand(Prefix + "stop")
.Alias("s") .Alias(Prefix + "s")
.Description("Stops the music and clears the playlist. Stays in the channel. | `!m s`") .Description("Stops the music and clears the playlist. Stays in the channel. | `!m s`")
.Do(e => .Do(e =>
{ {
@ -64,8 +64,8 @@ namespace NadekoBot.Modules.Music
} }
}); });
cgb.CreateCommand("destroy") cgb.CreateCommand(Prefix + "destroy")
.Alias("d") .Alias(Prefix + "d")
.Description("Completely stops the music and unbinds the bot from the channel. " + .Description("Completely stops the music and unbinds the bot from the channel. " +
"(may cause weird behaviour) | `!m d`") "(may cause weird behaviour) | `!m d`")
.Do(e => .Do(e =>
@ -76,8 +76,8 @@ namespace NadekoBot.Modules.Music
musicPlayer.Destroy(); musicPlayer.Destroy();
}); });
cgb.CreateCommand("pause") cgb.CreateCommand(Prefix + "pause")
.Alias("p") .Alias(Prefix + "p")
.Description("Pauses or Unpauses the song. | `!m p`") .Description("Pauses or Unpauses the song. | `!m p`")
.Do(async e => .Do(async e =>
{ {
@ -92,9 +92,9 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage("🎵`Music Player unpaused.`").ConfigureAwait(false); await e.Channel.SendMessage("🎵`Music Player unpaused.`").ConfigureAwait(false);
}); });
cgb.CreateCommand("queue") cgb.CreateCommand(Prefix + "queue")
.Alias("q") .Alias(Prefix + "q")
.Alias("yq") .Alias(Prefix + "yq")
.Description("Queue a song using keywords or a link. Bot will join your voice channel." + .Description("Queue a song using keywords or a link. Bot will join your voice channel." +
"**You must be in a voice channel**. | `!m q Dream Of Venice`") "**You must be in a voice channel**. | `!m q Dream Of Venice`")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
@ -108,8 +108,8 @@ namespace NadekoBot.Modules.Music
} }
}); });
cgb.CreateCommand("soundcloudqueue") cgb.CreateCommand(Prefix + "soundcloudqueue")
.Alias("sq") .Alias(Prefix + "sq")
.Description("Queue a soundcloud song using keywords. Bot will join your voice channel." + .Description("Queue a soundcloud song using keywords. Bot will join your voice channel." +
"**You must be in a voice channel**. | `!m sq Dream Of Venice`") "**You must be in a voice channel**. | `!m sq Dream Of Venice`")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
@ -123,8 +123,8 @@ namespace NadekoBot.Modules.Music
} }
}); });
cgb.CreateCommand("listqueue") cgb.CreateCommand(Prefix + "listqueue")
.Alias("lq") .Alias(Prefix + "lq")
.Description("Lists 15 currently queued songs per page. Default page is 1. | `!m lq` or `!m lq 2`") .Description("Lists 15 currently queued songs per page. Default page is 1. | `!m lq` or `!m lq 2`")
.Parameter("page", ParameterType.Optional) .Parameter("page", ParameterType.Optional)
.Do(async e => .Do(async e =>
@ -161,8 +161,8 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage(toSend + string.Join("\n", musicPlayer.Playlist.Skip(startAt).Take(15).Select(v => $"`{number++}.` {v.PrettyName}"))).ConfigureAwait(false); await e.Channel.SendMessage(toSend + string.Join("\n", musicPlayer.Playlist.Skip(startAt).Take(15).Select(v => $"`{number++}.` {v.PrettyName}"))).ConfigureAwait(false);
}); });
cgb.CreateCommand("nowplaying") cgb.CreateCommand(Prefix + "nowplaying")
.Alias("np") .Alias(Prefix + "np")
.Description("Shows the song currently playing. | `!m np`") .Description("Shows the song currently playing. | `!m np`")
.Do(async e => .Do(async e =>
{ {
@ -176,8 +176,8 @@ namespace NadekoBot.Modules.Music
$"{currentSong.PrettyCurrentTime()}").ConfigureAwait(false); $"{currentSong.PrettyCurrentTime()}").ConfigureAwait(false);
}); });
cgb.CreateCommand("volume") cgb.CreateCommand(Prefix + "volume")
.Alias("vol") .Alias(Prefix + "vol")
.Description("Sets the music volume 0-100% | `!m vol 50`") .Description("Sets the music volume 0-100% | `!m vol 50`")
.Parameter("val", ParameterType.Required) .Parameter("val", ParameterType.Required)
.Do(async e => .Do(async e =>
@ -198,8 +198,8 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage($"🎵 `Volume set to {volume}%`").ConfigureAwait(false); await e.Channel.SendMessage($"🎵 `Volume set to {volume}%`").ConfigureAwait(false);
}); });
cgb.CreateCommand("defvol") cgb.CreateCommand(Prefix + "defvol")
.Alias("dv") .Alias(Prefix + "dv")
.Description("Sets the default music volume when music playback is started (0-100)." + .Description("Sets the default music volume when music playback is started (0-100)." +
" Persists through restarts. | `!m dv 80`") " Persists through restarts. | `!m dv 80`")
.Parameter("val", ParameterType.Required) .Parameter("val", ParameterType.Required)
@ -217,8 +217,8 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage($"🎵 `Default volume set to {volume}%`").ConfigureAwait(false); await e.Channel.SendMessage($"🎵 `Default volume set to {volume}%`").ConfigureAwait(false);
}); });
cgb.CreateCommand("mute") cgb.CreateCommand(Prefix + "mute")
.Alias("min") .Alias(Prefix + "min")
.Description("Sets the music volume to 0% | `!m min`") .Description("Sets the music volume to 0% | `!m min`")
.Do(e => .Do(e =>
{ {
@ -230,7 +230,7 @@ namespace NadekoBot.Modules.Music
musicPlayer.SetVolume(0); musicPlayer.SetVolume(0);
}); });
cgb.CreateCommand("max") cgb.CreateCommand(Prefix + "max")
.Description("Sets the music volume to 100%. | `!m max`") .Description("Sets the music volume to 100%. | `!m max`")
.Do(e => .Do(e =>
{ {
@ -242,7 +242,7 @@ namespace NadekoBot.Modules.Music
musicPlayer.SetVolume(100); musicPlayer.SetVolume(100);
}); });
cgb.CreateCommand("half") cgb.CreateCommand(Prefix + "half")
.Description("Sets the music volume to 50%. | `!m half`") .Description("Sets the music volume to 50%. | `!m half`")
.Do(e => .Do(e =>
{ {
@ -254,8 +254,8 @@ namespace NadekoBot.Modules.Music
musicPlayer.SetVolume(50); musicPlayer.SetVolume(50);
}); });
cgb.CreateCommand("shuffle") cgb.CreateCommand(Prefix + "shuffle")
.Alias("sh") .Alias(Prefix + "sh")
.Description("Shuffles the current playlist. | `!m sh`") .Description("Shuffles the current playlist. | `!m sh`")
.Do(async e => .Do(async e =>
{ {
@ -274,8 +274,8 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage("🎵 `Songs shuffled.`").ConfigureAwait(false); await e.Channel.SendMessage("🎵 `Songs shuffled.`").ConfigureAwait(false);
}); });
cgb.CreateCommand("playlist") cgb.CreateCommand(Prefix + "playlist")
.Alias("pl") .Alias(Prefix + "pl")
.Description("Queues up to 500 songs from a youtube playlist specified by a link, or keywords. | `!m pl playlist link or name`") .Description("Queues up to 500 songs from a youtube playlist specified by a link, or keywords. | `!m pl playlist link or name`")
.Parameter("playlist", ParameterType.Unparsed) .Parameter("playlist", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -318,8 +318,8 @@ namespace NadekoBot.Modules.Music
await msg.Edit("🎵 `Playlist queue complete.`").ConfigureAwait(false); await msg.Edit("🎵 `Playlist queue complete.`").ConfigureAwait(false);
}); });
cgb.CreateCommand("soundcloudpl") cgb.CreateCommand(Prefix + "soundcloudpl")
.Alias("scpl") .Alias(Prefix + "scpl")
.Description("Queue a soundcloud playlist using a link. | `!m scpl https://soundcloud.com/saratology/sets/symphony`") .Description("Queue a soundcloud playlist using a link. | `!m scpl https://soundcloud.com/saratology/sets/symphony`")
.Parameter("pl", ParameterType.Unparsed) .Parameter("pl", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -353,8 +353,8 @@ namespace NadekoBot.Modules.Music
} }
}); });
cgb.CreateCommand("localplaylst") cgb.CreateCommand(Prefix + "localplaylst")
.Alias("lopl") .Alias(Prefix + "lopl")
.Description("Queues all songs from a directory. **Bot Owner Only!** | `!m lopl C:/music/classical`") .Description("Queues all songs from a directory. **Bot Owner Only!** | `!m lopl C:/music/classical`")
.Parameter("directory", ParameterType.Unparsed) .Parameter("directory", ParameterType.Unparsed)
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
@ -384,7 +384,7 @@ namespace NadekoBot.Modules.Music
catch { } catch { }
}); });
cgb.CreateCommand("radio").Alias("ra") cgb.CreateCommand(Prefix + "radio").Alias(Prefix + "ra")
.Description("Queues a radio stream from a link. It can be a direct mp3 radio stream, .m3u, .pls .asx or .xspf (Usage Video: <https://streamable.com/al54>) | `!m ra radio link here`") .Description("Queues a radio stream from a link. It can be a direct mp3 radio stream, .m3u, .pls .asx or .xspf (Usage Video: <https://streamable.com/al54>) | `!m ra radio link here`")
.Parameter("radio_link", ParameterType.Required) .Parameter("radio_link", ParameterType.Required)
.Do(async e => .Do(async e =>
@ -402,8 +402,8 @@ namespace NadekoBot.Modules.Music
} }
}); });
cgb.CreateCommand("local") cgb.CreateCommand(Prefix + "local")
.Alias("lo") .Alias(Prefix + "lo")
.Description("Queues a local file by specifying a full path. **Bot Owner Only!** | `!m lo C:/music/mysong.mp3`") .Description("Queues a local file by specifying a full path. **Bot Owner Only!** | `!m lo C:/music/mysong.mp3`")
.Parameter("path", ParameterType.Unparsed) .Parameter("path", ParameterType.Unparsed)
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
@ -415,8 +415,8 @@ namespace NadekoBot.Modules.Music
await QueueSong(e.User, e.Channel, e.User.VoiceChannel, e.GetArg("path"), musicType: MusicType.Local).ConfigureAwait(false); await QueueSong(e.User, e.Channel, e.User.VoiceChannel, e.GetArg("path"), musicType: MusicType.Local).ConfigureAwait(false);
}); });
cgb.CreateCommand("move") cgb.CreateCommand(Prefix + "move")
.Alias("mv") .Alias(Prefix + "mv")
.Description("Moves the bot to your voice channel. (works only if music is already playing) | `!m mv`") .Description("Moves the bot to your voice channel. (works only if music is already playing) | `!m mv`")
.Do(e => .Do(e =>
{ {
@ -427,8 +427,8 @@ namespace NadekoBot.Modules.Music
musicPlayer.MoveToVoiceChannel(voiceChannel); musicPlayer.MoveToVoiceChannel(voiceChannel);
}); });
cgb.CreateCommand("remove") cgb.CreateCommand(Prefix + "remove")
.Alias("rm") .Alias(Prefix + "rm")
.Description("Remove a song by its # in the queue, or 'all' to remove whole queue. | `!m rm 5`") .Description("Remove a song by its # in the queue, or 'all' to remove whole queue. | `!m rm 5`")
.Parameter("num", ParameterType.Required) .Parameter("num", ParameterType.Required)
.Do(async e => .Do(async e =>
@ -460,8 +460,8 @@ namespace NadekoBot.Modules.Music
}); });
//var msRegex = new Regex(@"(?<n1>\d+)>(?<n2>\d+)", RegexOptions.Compiled); //var msRegex = new Regex(@"(?<n1>\d+)>(?<n2>\d+)", RegexOptions.Compiled);
cgb.CreateCommand("movesong") cgb.CreateCommand(Prefix + "movesong")
.Alias("ms") .Alias(Prefix + "ms")
.Description($"Moves a song from one position to another. | `{Prefix} ms` 5>3") .Description($"Moves a song from one position to another. | `{Prefix} ms` 5>3")
.Parameter("fromto") .Parameter("fromto")
.Do(async e => .Do(async e =>
@ -496,8 +496,8 @@ namespace NadekoBot.Modules.Music
}); });
cgb.CreateCommand("setmaxqueue") cgb.CreateCommand(Prefix + "setmaxqueue")
.Alias("smq") .Alias(Prefix + "smq")
.Description($"Sets a maximum queue size. Supply 0 or no argument to have no limit. | `{Prefix} smq` 50 or `{Prefix} smq`") .Description($"Sets a maximum queue size. Supply 0 or no argument to have no limit. | `{Prefix} smq` 50 or `{Prefix} smq`")
.Parameter("size", ParameterType.Unparsed) .Parameter("size", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -519,7 +519,7 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage($"🎵 `Max queue set to {(size == 0 ? ("unlimited") : size + " tracks")}`"); await e.Channel.SendMessage($"🎵 `Max queue set to {(size == 0 ? ("unlimited") : size + " tracks")}`");
}); });
cgb.CreateCommand("cleanup") cgb.CreateCommand(Prefix + "cleanup")
.Description("Cleans up hanging voice connections. **Bot Owner Only!** | `!m cleanup`") .Description("Cleans up hanging voice connections. **Bot Owner Only!** | `!m cleanup`")
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
.Do(e => .Do(e =>
@ -537,8 +537,8 @@ namespace NadekoBot.Modules.Music
} }
}); });
cgb.CreateCommand("reptcursong") cgb.CreateCommand(Prefix + "reptcursong")
.Alias("rcs") .Alias(Prefix + "rcs")
.Description("Toggles repeat of current song. | `!m rcs`") .Description("Toggles repeat of current song. | `!m rcs`")
.Do(async e => .Do(async e =>
{ {
@ -555,8 +555,8 @@ namespace NadekoBot.Modules.Music
.ConfigureAwait(false); .ConfigureAwait(false);
}); });
cgb.CreateCommand("rpeatplaylst") cgb.CreateCommand(Prefix + "rpeatplaylst")
.Alias("rpl") .Alias(Prefix + "rpl")
.Description("Toggles repeat of all songs in the queue (every song that finishes is added to the end of the queue). | `!m rpl`") .Description("Toggles repeat of all songs in the queue (every song that finishes is added to the end of the queue). | `!m rpl`")
.Do(async e => .Do(async e =>
{ {
@ -567,7 +567,7 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage($"🎵🔁`Repeat playlist {(currentValue ? "enabled" : "disabled")}`").ConfigureAwait(false); await e.Channel.SendMessage($"🎵🔁`Repeat playlist {(currentValue ? "enabled" : "disabled")}`").ConfigureAwait(false);
}); });
cgb.CreateCommand("save") cgb.CreateCommand(Prefix + "save")
.Description("Saves a playlist under a certain name. Name must be no longer than 20 characters and mustn't contain dashes. | `!m save classical1`") .Description("Saves a playlist under a certain name. Name must be no longer than 20 characters and mustn't contain dashes. | `!m save classical1`")
.Parameter("name", ParameterType.Unparsed) .Parameter("name", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -620,7 +620,7 @@ namespace NadekoBot.Modules.Music
}); });
cgb.CreateCommand("load") cgb.CreateCommand(Prefix + "load")
.Description("Loads a playlist under a certain name. | `!m load classical-1`") .Description("Loads a playlist under a certain name. | `!m load classical-1`")
.Parameter("name", ParameterType.Unparsed) .Parameter("name", ParameterType.Unparsed)
.Do(async e => .Do(async e =>
@ -679,8 +679,8 @@ namespace NadekoBot.Modules.Music
} }
}); });
cgb.CreateCommand("playlists") cgb.CreateCommand(Prefix + "playlists")
.Alias("pls") .Alias(Prefix + "pls")
.Description("Lists all playlists. Paginated. 20 per page. Default page is 0. |`!m pls 1`") .Description("Lists all playlists. Paginated. 20 per page. Default page is 0. |`!m pls 1`")
.Parameter("num", ParameterType.Optional) .Parameter("num", ParameterType.Optional)
.Do(e => .Do(e =>
@ -696,8 +696,8 @@ namespace NadekoBot.Modules.Music
e.Channel.SendMessage($"```js\n--- List of saved playlists ---\n\n" + string.Join("\n", result.Select(r => $"'{r.Name}-{r.Id}' by {r.Creator} ({r.SongCnt} songs)")) + $"\n\n --- Page {num} ---```").ConfigureAwait(false); e.Channel.SendMessage($"```js\n--- List of saved playlists ---\n\n" + string.Join("\n", result.Select(r => $"'{r.Name}-{r.Id}' by {r.Creator} ({r.SongCnt} songs)")) + $"\n\n --- Page {num} ---```").ConfigureAwait(false);
}); });
cgb.CreateCommand("deleteplaylist") cgb.CreateCommand(Prefix + "deleteplaylist")
.Alias("delpls") .Alias(Prefix + "delpls")
.Description("Deletes a saved playlist. Only if you made it or if you are the bot owner. | `!m delpls animu-5`") .Description("Deletes a saved playlist. Only if you made it or if you are the bot owner. | `!m delpls animu-5`")
.Parameter("pl", ParameterType.Required) .Parameter("pl", ParameterType.Required)
.Do(async e => .Do(async e =>
@ -713,7 +713,7 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage("`Ok.` :ok:").ConfigureAwait(false); await e.Channel.SendMessage("`Ok.` :ok:").ConfigureAwait(false);
}); });
cgb.CreateCommand("goto") cgb.CreateCommand(Prefix + "goto")
.Description("Goes to a specific time in seconds in a song.") .Description("Goes to a specific time in seconds in a song.")
.Parameter("time") .Parameter("time")
.Do(async e => .Do(async e =>
@ -750,8 +750,8 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage($"`Skipped to {minutes}:{seconds}`").ConfigureAwait(false); await e.Channel.SendMessage($"`Skipped to {minutes}:{seconds}`").ConfigureAwait(false);
}); });
cgb.CreateCommand("getlink") cgb.CreateCommand(Prefix + "getlink")
.Alias("gl") .Alias(Prefix + "gl")
.Description("Shows a link to the currently playing song.") .Description("Shows a link to the currently playing song.")
.Do(async e => .Do(async e =>
{ {
@ -764,8 +764,8 @@ namespace NadekoBot.Modules.Music
await e.Channel.SendMessage($"🎶`Current song:` <{curSong.SongInfo.Query}>").ConfigureAwait(false); await e.Channel.SendMessage($"🎶`Current song:` <{curSong.SongInfo.Query}>").ConfigureAwait(false);
}); });
cgb.CreateCommand("autoplay") cgb.CreateCommand(Prefix + "autoplay")
.Alias("ap") .Alias(Prefix + "ap")
.Description("Toggles autoplay - When the song is finished, automatically queue a related youtube song. (Works only for youtube songs and when queue is empty)") .Description("Toggles autoplay - When the song is finished, automatically queue a related youtube song. (Works only for youtube songs and when queue is empty)")
.Do(async e => .Do(async e =>
{ {

View File

@ -175,7 +175,7 @@ Nadeko Support Server: <https://discord.gg/0ehQwTK2RBjAxzEY>";
public string Conversations { get; set; } = "<@{0}>"; public string Conversations { get; set; } = "<@{0}>";
public string ClashOfClans { get; set; } = ","; public string ClashOfClans { get; set; } = ",";
public string Help { get; set; } = "-"; public string Help { get; set; } = "-";
public string Music { get; set; } = "!m"; public string Music { get; set; } = "!!";
public string Trello { get; set; } = "trello "; public string Trello { get; set; } = "trello ";
public string Games { get; set; } = ">"; public string Games { get; set; } = ">";
public string Gambling { get; set; } = "$"; public string Gambling { get; set; } = "$";

View File

@ -83,7 +83,7 @@
"Conversations": "<@{0}>", "Conversations": "<@{0}>",
"ClashOfClans": ",", "ClashOfClans": ",",
"Help": "-", "Help": "-",
"Music": "!m", "Music": "!!",
"Trello": "trello ", "Trello": "trello ",
"Games": ">", "Games": ">",
"Gambling": "$", "Gambling": "$",