!m lopl will no longer queue hidden and system files.
This commit is contained in:
parent
ccb2d2a187
commit
633c38ba13
@ -9,6 +9,7 @@ using NadekoBot.Extensions;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@ -288,10 +289,11 @@ namespace NadekoBot.Modules
|
|||||||
return;
|
return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var fileEnum = System.IO.Directory.EnumerateFiles(arg).Take(50);
|
var fileEnum = new DirectoryInfo(arg).GetFiles()
|
||||||
|
.Where(x => !x.Attributes.HasFlag(FileAttributes.Hidden | FileAttributes.System));
|
||||||
foreach (var file in fileEnum)
|
foreach (var file in fileEnum)
|
||||||
{
|
{
|
||||||
await QueueSong(e.Channel, e.User.VoiceChannel, file, true, MusicType.Local);
|
await QueueSong(e.Channel, e.User.VoiceChannel, file.FullName, true, MusicType.Local);
|
||||||
}
|
}
|
||||||
await e.Channel.SendMessage("🎵 `Directory queue complete.`");
|
await e.Channel.SendMessage("🎵 `Directory queue complete.`");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user