Better messages, radio, osu impl. started, trivia fix, questions fixed
This commit is contained in:
@ -20,7 +20,7 @@ namespace NadekoBot.Modules {
|
||||
private string firestr = "🔥 ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้ 🔥";
|
||||
public Conversations() : base() {
|
||||
commands.Add(new CopyCommand());
|
||||
if(NadekoBot.ParseActive)
|
||||
if (NadekoBot.ParseActive)
|
||||
commands.Add(new RequestsCommand());
|
||||
else
|
||||
Console.WriteLine("Requests don't work, parse not valid.");
|
||||
@ -82,11 +82,11 @@ namespace NadekoBot.Modules {
|
||||
return;
|
||||
}
|
||||
|
||||
if (randServerSW.ElapsedMilliseconds / 1000 < 1800) {
|
||||
await e.Send("You have to wait " + (1800 - randServerSW.ElapsedMilliseconds / 1000) + " more seconds to use this function.");
|
||||
if (randServerSW.Elapsed.Seconds < 1800) {
|
||||
await e.Send("You have to wait " + (1800 - randServerSW.Elapsed.Seconds) + " more seconds to use this function.");
|
||||
return;
|
||||
}
|
||||
randServerSW.Reset();
|
||||
randServerSW.Restart();
|
||||
while (true) {
|
||||
var server = client.Servers.OrderBy(x => rng.Next()).FirstOrDefault();
|
||||
if (server == null)
|
||||
@ -198,7 +198,13 @@ namespace NadekoBot.Modules {
|
||||
string[] pats = new string[] { "http://i.imgur.com/IiQwK12.gif",
|
||||
"http://i.imgur.com/JCXj8yD.gif",
|
||||
"http://i.imgur.com/qqBl2bm.gif",
|
||||
"http://i.imgur.com/eOJlnwP.gif" };
|
||||
"http://i.imgur.com/eOJlnwP.gif",
|
||||
"https://45.media.tumblr.com/229ec0458891c4dcd847545c81e760a5/tumblr_mpfy232F4j1rxrpjzo1_r2_500.gif",
|
||||
"https://media.giphy.com/media/KZQlfylo73AMU/giphy.gif",
|
||||
"https://media.giphy.com/media/12hvLuZ7uzvCvK/giphy.gif",
|
||||
"http://gallery1.anivide.com/_full/65030_1382582341.gif",
|
||||
"https://49.media.tumblr.com/8e8a099c4eba22abd3ec0f70fd087cce/tumblr_nxovj9oY861ur1mffo1_500.gif ",
|
||||
};
|
||||
await e.Send($"{e.Message.MentionedUsers.First().Mention} {pats[new Random().Next(0, pats.Length)]}");
|
||||
});
|
||||
|
||||
@ -313,7 +319,7 @@ namespace NadekoBot.Modules {
|
||||
.Description("Useless. Writes calling @X to chat.\n**Usage**: @NadekoBot call @X ")
|
||||
.Parameter("who", ParameterType.Required)
|
||||
.Do(async e => {
|
||||
await e.Send("Calling " + e.Args[0].Replace("@everyone","[everyone]") + "...");
|
||||
await e.Send("Calling " + e.Args[0].Replace("@everyone", "[everyone]") + "...");
|
||||
});
|
||||
cgb.CreateCommand("hide")
|
||||
.Description("Hides nadeko in plain sight!11!!")
|
||||
@ -359,7 +365,7 @@ namespace NadekoBot.Modules {
|
||||
.Do(async e => {
|
||||
string[] strings = { "ba", "la", "ha" };
|
||||
string construct = "@a";
|
||||
int cnt = rng.Next(4,7);
|
||||
int cnt = rng.Next(4, 7);
|
||||
while (cnt-- > 0) {
|
||||
construct += strings[rng.Next(0, strings.Length)];
|
||||
}
|
||||
|
@ -98,7 +98,8 @@ namespace NadekoBot.Modules {
|
||||
await e.Send("Volume number invalid.");
|
||||
return;
|
||||
}
|
||||
player.SetVolume(volume);
|
||||
volume = player.SetVolume(volume);
|
||||
await e.Send($":musical_note:Volume set to {volume}50%");
|
||||
});
|
||||
|
||||
cgb.CreateCommand("min").Alias("mute")
|
||||
@ -164,13 +165,29 @@ namespace NadekoBot.Modules {
|
||||
.Description("Queues up to 25 songs from a youtube playlist specified by a link, or keywords.")
|
||||
.Parameter("playlist", ParameterType.Unparsed)
|
||||
.Do(async e => {
|
||||
if (e.User.VoiceChannel?.Server != e.Server) {
|
||||
await e.Send(":anger: You need to be in the voice channel on this server.");
|
||||
return;
|
||||
}
|
||||
var ids = await Searches.GetVideoIDs(await Searches.GetPlaylistIdByKeyword(e.GetArg("playlist")));
|
||||
//todo TEMPORARY SOLUTION, USE RESOLVE QUEUE IN THE FUTURE
|
||||
await e.Send($"Attempting to queue {ids.Count} songs".SnPl(ids.Count));
|
||||
var msg = await e.Send($":musical_note: Attempting to queue {ids.Count} songs".SnPl(ids.Count));
|
||||
foreach (var id in ids) {
|
||||
Task.Run(async () => await QueueSong(e, id, true)).ConfigureAwait(false);
|
||||
await Task.Delay(150);
|
||||
}
|
||||
msg?.Edit(":musical_note:Playlist queue complete.");
|
||||
});
|
||||
|
||||
cgb.CreateCommand("radio").Alias("ra")
|
||||
.Description("Queues a direct radio stream from a link.")
|
||||
.Parameter("radio_link", ParameterType.Required)
|
||||
.Do(async e => {
|
||||
if (e.User.VoiceChannel?.Server != e.Server) {
|
||||
await e.Send(":anger: You need to be in the voice channel on this server.");
|
||||
return;
|
||||
}
|
||||
await QueueSong(e, e.GetArg("radio_link"), radio: true);
|
||||
});
|
||||
|
||||
cgb.CreateCommand("debug")
|
||||
@ -183,7 +200,7 @@ namespace NadekoBot.Modules {
|
||||
});
|
||||
}
|
||||
|
||||
private async Task QueueSong(CommandEventArgs e, string query, bool silent = false) {
|
||||
private async Task QueueSong(CommandEventArgs e, string query, bool silent = false, bool radio = false) {
|
||||
if (e.User.VoiceChannel?.Server != e.Server) {
|
||||
await e.Send(":anger: You need to be in the voice channel on this server.");
|
||||
return;
|
||||
@ -201,7 +218,7 @@ namespace NadekoBot.Modules {
|
||||
if (player.SongQueue.Count >= 25) return;
|
||||
|
||||
try {
|
||||
var sr = await Task.Run(() => new StreamRequest(e, query, player));
|
||||
var sr = await Task.Run(() => new StreamRequest(e, query, player, radio));
|
||||
|
||||
if (sr == null)
|
||||
throw new NullReferenceException("StreamRequest is null.");
|
||||
|
@ -136,6 +136,7 @@ namespace NadekoBot.Modules {
|
||||
await e.Send("http://i.imgur.com/MZkY1md.jpg");
|
||||
});
|
||||
cgb.CreateCommand("lmgtfy")
|
||||
.Alias("~lmgtfy")
|
||||
.Description("Google something for an idiot.")
|
||||
.Parameter("ffs", ParameterType.Unparsed)
|
||||
.Do(async e => {
|
||||
@ -152,6 +153,7 @@ namespace NadekoBot.Modules {
|
||||
await e.Send(":anger: Please enter a card name to search for.");
|
||||
return;
|
||||
}
|
||||
await e.Channel.SendIsTyping();
|
||||
var res = await GetResponseAsync($"https://omgvamp-hearthstone-v1.p.mashape.com/cards/search/{Uri.EscapeUriString(arg)}",
|
||||
new Tuple<string, string>[] {
|
||||
new Tuple<string, string>("X-Mashape-Key", NadekoBot.creds.MashapeKey),
|
||||
@ -181,6 +183,32 @@ namespace NadekoBot.Modules {
|
||||
await e.Send($":anger: Error {ex}");
|
||||
}
|
||||
});
|
||||
|
||||
cgb.CreateCommand("~osu")
|
||||
.Description("desc")
|
||||
.Parameter("arg", ParameterType.Required)
|
||||
.Do(async e => {
|
||||
var arg = e.GetArg("arg");
|
||||
//make request to osu
|
||||
//print useful data
|
||||
});
|
||||
|
||||
cgb.CreateCommand("~osubind")
|
||||
.Description("Bind discord user to osu name\n**Usage**: ~osubind @MyDiscordName My osu name")
|
||||
.Parameter("user_name", ParameterType.Required)
|
||||
.Parameter("osu_name", ParameterType.Unparsed)
|
||||
.Do(async e => {
|
||||
var userName = e.GetArg("user_name");
|
||||
var osuName = e.GetArg("osu_name");
|
||||
var usr = e.Server.FindUsers(userName).FirstOrDefault();
|
||||
if (usr == null) {
|
||||
await e.Send("Cannot find that discord user.");
|
||||
return;
|
||||
}
|
||||
//query for a username
|
||||
//if exists save bind pair to parse.com
|
||||
//if not valid error
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user