added .togethertube command, #586
This commit is contained in:
parent
29b06567bd
commit
ee4d17c3d0
@ -5,6 +5,7 @@ using NadekoBot.Attributes;
|
|||||||
using NadekoBot.Extensions;
|
using NadekoBot.Extensions;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@ -12,6 +13,23 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
partial class Utility : DiscordModule
|
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]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task ServerInfo(IUserMessage msg, string guild = null)
|
public async Task ServerInfo(IUserMessage msg, string guild = null)
|
||||||
|
27
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
27
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
@ -6350,6 +6350,33 @@ namespace NadekoBot.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to togethertube totube.
|
||||||
|
/// </summary>
|
||||||
|
public static string togethertube_cmd {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("togethertube_cmd", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Creates a new room on <https://togethertube.com> and shows the link in the chat..
|
||||||
|
/// </summary>
|
||||||
|
public static string togethertube_desc {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("togethertube_desc", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to `{0}totube`.
|
||||||
|
/// </summary>
|
||||||
|
public static string togethertube_usage {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("togethertube_usage", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to tq.
|
/// Looks up a localized string similar to tq.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2511,4 +2511,13 @@
|
|||||||
<data name="xkcd_usage" xml:space="preserve">
|
<data name="xkcd_usage" xml:space="preserve">
|
||||||
<value>`{0}xkcd` or `{0}xkcd 1400` or `{0}xkcd latest`</value>
|
<value>`{0}xkcd` or `{0}xkcd 1400` or `{0}xkcd latest`</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="togethertube_cmd" xml:space="preserve">
|
||||||
|
<value>togethertube totube</value>
|
||||||
|
</data>
|
||||||
|
<data name="togethertube_desc" xml:space="preserve">
|
||||||
|
<value>Creates a new room on <https://togethertube.com> and shows the link in the chat.</value>
|
||||||
|
</data>
|
||||||
|
<data name="togethertube_usage" xml:space="preserve">
|
||||||
|
<value>`{0}totube`</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
Loading…
Reference in New Issue
Block a user