together tube readded
This commit is contained in:
parent
32bf0a3c46
commit
937f775db4
@ -15,6 +15,7 @@ using Discord.API;
|
|||||||
using Embed = Discord.API.Embed;
|
using Embed = Discord.API.Embed;
|
||||||
using EmbedAuthor = Discord.API.EmbedAuthor;
|
using EmbedAuthor = Discord.API.EmbedAuthor;
|
||||||
using EmbedField = Discord.API.EmbedField;
|
using EmbedField = Discord.API.EmbedField;
|
||||||
|
using System.Net.Http;
|
||||||
|
|
||||||
namespace NadekoBot.Modules.Utility
|
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]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task WhosPlaying(IUserMessage umsg, [Remainder] string game = null)
|
public async Task WhosPlaying(IUserMessage umsg, [Remainder] string game = null)
|
||||||
|
Loading…
Reference in New Issue
Block a user