diff --git a/NadekoBot/Modules/Music/Classes/Song.cs b/NadekoBot/Modules/Music/Classes/Song.cs index 6ebf97d2..4cf1d01d 100644 --- a/NadekoBot/Modules/Music/Classes/Song.cs +++ b/NadekoBot/Modules/Music/Classes/Song.cs @@ -260,7 +260,11 @@ namespace NadekoBot.Modules.Music.Classes if (video == null) // do something with this error throw new Exception("Could not load any video elements based on the query."); - return new Song(new SongInfo + var m = Regex.Match(query, @"\?t=(?\d*)"); + int gotoTime = 0; + if (m.Captures.Count > 0) + int.TryParse(m.Groups["t"].ToString(), out gotoTime); + var song = new Song(new SongInfo { Title = video.Title.Substring(0, video.Title.Length - 10), // removing trailing "- You Tube" Provider = "YouTube", @@ -268,6 +272,8 @@ namespace NadekoBot.Modules.Music.Classes Query = link, ProviderType = musicType, }); + song.SkipTo = gotoTime; + return song; } catch (Exception ex) { diff --git a/NadekoBot/Modules/Translator/TranslateCommand.cs b/NadekoBot/Modules/Translator/TranslateCommand.cs index 0c4ae502..2ac7b43c 100644 --- a/NadekoBot/Modules/Translator/TranslateCommand.cs +++ b/NadekoBot/Modules/Translator/TranslateCommand.cs @@ -13,7 +13,8 @@ namespace NadekoBot.Modules.Translator internal override void Init(CommandGroupBuilder cgb) { cgb.CreateCommand(Module.Prefix + "trans") - .Description("Translates from>to text. From the given language to the destiation language.") + .Alias(Module.Prefix + "translate") + .Description($"Translates from>to text. From the given language to the destiation language.\n**Usage**: {Module.Prefix}trans en>fr Hello") .Parameter("langs", ParameterType.Required) .Parameter("text", ParameterType.Unparsed) .Do(TranslateFunc());