fixes to slm, @everyone copyme and slm

This commit is contained in:
Master Kwoth 2016-01-29 14:33:02 +01:00
parent 805c592fff
commit 1316c83bd4
5 changed files with 12 additions and 11 deletions

View File

@ -49,9 +49,10 @@ namespace NadekoBot.Classes.Music {
lock (_voiceLock) {
CurrentSong?.Stop();
CurrentSong = null;
if (SongQueue.Count == 0) return;
if (SongQueue.Count != 0) {
CurrentSong = SongQueue[0];
SongQueue.RemoveAt(0);
} else return;
}
try {
@ -69,9 +70,9 @@ namespace NadekoBot.Classes.Music {
if(kvp != null)
kvp.Cancel();
}
SongQueue.Clear();
SongQueue?.Clear();
LoadNextSong();
VoiceClient.Disconnect();
VoiceClient?.Disconnect();
VoiceClient = null;
}
}

View File

@ -168,7 +168,7 @@ namespace NadekoBot.Classes.Music {
Task.Run(() => bufferCancelSource.Cancel());
}
await Task.Delay(50);
await Task.Delay(500);
}
if (State == StreamState.Completed) {

View File

@ -20,7 +20,7 @@ namespace NadekoBot
private async void Client_MessageReceived(object sender, Discord.MessageEventArgs e)
{
if (CopiedUsers.Contains(e.User.Id)) {
await e.Send( e.Message.Text);
await e.Send( e.Message.Text.Replace("@everyone","@everryone"));
}
}

View File

@ -323,18 +323,18 @@ namespace NadekoBot.Modules
Message msg;
var msgs = e.Channel.Messages
.Where(m => m.MentionedUsers.Contains(e.User))
.OrderBy(m => m.Timestamp);
.OrderByDescending(m => m.Timestamp);
if (msgs.Count() > 0)
msg = msgs.FirstOrDefault();
else {
var msgsarr = await e.Channel.DownloadMessages(10000);
msg = msgsarr
.Where(m => m.MentionedUsers.Contains(e.User))
.OrderBy(m => m.Timestamp)
.OrderByDescending(m => m.Timestamp)
.FirstOrDefault();
}
if (msg != null)
await e.Send("Last message mentioning you was at " + msg.Timestamp + "\n**Message:** " + msg.RawText);
await e.Send("Last message mentioning you was at " + msg.Timestamp + "\n**Message:** " + msg.RawText.Replace("@everyone","@everryone"));
else
await e.Send("I can't find a message mentioning you.");
});

View File

@ -23,7 +23,7 @@ namespace NadekoBot {
public static string password;
public static string TrelloAppKey;
public static bool ForwardMessages = false;
public static string BotVersion = "0.8-beta1";
public static string BotVersion = "0.8-beta2";
public static int commandsRan = 0;
static void Main() {