fixes to slm, @everyone copyme and slm
This commit is contained in:
parent
805c592fff
commit
1316c83bd4
@ -49,9 +49,10 @@ namespace NadekoBot.Classes.Music {
|
|||||||
lock (_voiceLock) {
|
lock (_voiceLock) {
|
||||||
CurrentSong?.Stop();
|
CurrentSong?.Stop();
|
||||||
CurrentSong = null;
|
CurrentSong = null;
|
||||||
if (SongQueue.Count == 0) return;
|
if (SongQueue.Count != 0) {
|
||||||
CurrentSong = SongQueue[0];
|
CurrentSong = SongQueue[0];
|
||||||
SongQueue.RemoveAt(0);
|
SongQueue.RemoveAt(0);
|
||||||
|
} else return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -69,9 +70,9 @@ namespace NadekoBot.Classes.Music {
|
|||||||
if(kvp != null)
|
if(kvp != null)
|
||||||
kvp.Cancel();
|
kvp.Cancel();
|
||||||
}
|
}
|
||||||
SongQueue.Clear();
|
SongQueue?.Clear();
|
||||||
LoadNextSong();
|
LoadNextSong();
|
||||||
VoiceClient.Disconnect();
|
VoiceClient?.Disconnect();
|
||||||
VoiceClient = null;
|
VoiceClient = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ namespace NadekoBot.Classes.Music {
|
|||||||
Task.Run(() => bufferCancelSource.Cancel());
|
Task.Run(() => bufferCancelSource.Cancel());
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(50);
|
await Task.Delay(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (State == StreamState.Completed) {
|
if (State == StreamState.Completed) {
|
||||||
|
@ -20,7 +20,7 @@ namespace NadekoBot
|
|||||||
private async void Client_MessageReceived(object sender, Discord.MessageEventArgs e)
|
private async void Client_MessageReceived(object sender, Discord.MessageEventArgs e)
|
||||||
{
|
{
|
||||||
if (CopiedUsers.Contains(e.User.Id)) {
|
if (CopiedUsers.Contains(e.User.Id)) {
|
||||||
await e.Send( e.Message.Text);
|
await e.Send( e.Message.Text.Replace("@everyone","@everryone"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,18 +323,18 @@ namespace NadekoBot.Modules
|
|||||||
Message msg;
|
Message msg;
|
||||||
var msgs = e.Channel.Messages
|
var msgs = e.Channel.Messages
|
||||||
.Where(m => m.MentionedUsers.Contains(e.User))
|
.Where(m => m.MentionedUsers.Contains(e.User))
|
||||||
.OrderBy(m => m.Timestamp);
|
.OrderByDescending(m => m.Timestamp);
|
||||||
if (msgs.Count() > 0)
|
if (msgs.Count() > 0)
|
||||||
msg = msgs.FirstOrDefault();
|
msg = msgs.FirstOrDefault();
|
||||||
else {
|
else {
|
||||||
var msgsarr = await e.Channel.DownloadMessages(10000);
|
var msgsarr = await e.Channel.DownloadMessages(10000);
|
||||||
msg = msgsarr
|
msg = msgsarr
|
||||||
.Where(m => m.MentionedUsers.Contains(e.User))
|
.Where(m => m.MentionedUsers.Contains(e.User))
|
||||||
.OrderBy(m => m.Timestamp)
|
.OrderByDescending(m => m.Timestamp)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
}
|
}
|
||||||
if (msg != null)
|
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
|
else
|
||||||
await e.Send("I can't find a message mentioning you.");
|
await e.Send("I can't find a message mentioning you.");
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ namespace NadekoBot {
|
|||||||
public static string password;
|
public static string password;
|
||||||
public static string TrelloAppKey;
|
public static string TrelloAppKey;
|
||||||
public static bool ForwardMessages = false;
|
public static bool ForwardMessages = false;
|
||||||
public static string BotVersion = "0.8-beta1";
|
public static string BotVersion = "0.8-beta2";
|
||||||
public static int commandsRan = 0;
|
public static int commandsRan = 0;
|
||||||
|
|
||||||
static void Main() {
|
static void Main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user