diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index e4e2fe31..a61d6f69 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -15,6 +15,7 @@ using Discord.API; using Embed = Discord.API.Embed; using EmbedAuthor = Discord.API.EmbedAuthor; using EmbedField = Discord.API.EmbedField; +using System.Net.Http; namespace NadekoBot.Modules.Utility { @@ -27,6 +28,27 @@ namespace NadekoBot.Modules.Utility } + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + public async Task TogetherTube(IUserMessage imsg) + { + var channel = (ITextChannel)imsg.Channel; + + Uri target; + using (var http = new HttpClient()) + { + var res = await http.GetAsync("https://togethertube.com/room/create").ConfigureAwait(false); + target = res.RequestMessage.RequestUri; + } + + await channel.EmbedAsync(new EmbedBuilder().WithOkColor() + .WithAuthor(eab => eab.WithIconUrl("https://togethertube.com/assets/img/favicons/favicon-32x32.png") + .WithName("Together Tube") + .WithUrl("https://togethertube.com/")) + .WithDescription($"{imsg.Author.Mention} Here is your room link:\n{target}") + .Build()); + } + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] public async Task WhosPlaying(IUserMessage umsg, [Remainder] string game = null)