added .togethertube command, #586

This commit is contained in:
Kwoth
2016-10-24 14:17:17 +02:00
parent 29b06567bd
commit ee4d17c3d0
3 changed files with 54 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ using NadekoBot.Attributes;
using NadekoBot.Extensions;
using System;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
@@ -12,6 +13,23 @@ namespace NadekoBot.Modules.Utility
{
partial class Utility : DiscordModule
{
[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.SendMessageAsync($"{imsg.Author.Mention}, `Here is the link:` {target}")
.ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task ServerInfo(IUserMessage msg, string guild = null)