cleanup, added prune command

This commit is contained in:
Kwoth 2016-01-10 15:49:31 +01:00
parent e1d1f196fe
commit 1d632b61d8
4 changed files with 40 additions and 8 deletions

View File

@ -140,6 +140,7 @@ namespace NadekoBot
private async void PotentialGuess(object sender, MessageEventArgs e) private async void PotentialGuess(object sender, MessageEventArgs e)
{ {
if (e.Server == null || e.Channel == null) return;
if (e.Server.Id != _serverId || !active) if (e.Server.Id != _serverId || !active)
return; return;

View File

@ -274,8 +274,22 @@ namespace NadekoBot.Modules
var time = (DateTime.Now - Process.GetCurrentProcess().StartTime); var time = (DateTime.Now - Process.GetCurrentProcess().StartTime);
string uptime = " " + time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes."; string uptime = " " + time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes.";
await e.Send( String.Format("```Servers: {0}\nUnique Users: {1}\nUptime: {2}\nMy id is: {3}```", serverCount, uniqueUserCount, uptime, client.CurrentUser.Id)); await e.Send($"```Servers: {serverCount}\nUnique Users: {uniqueUserCount}\nUptime: {uptime}\nMy id is: {client.CurrentUser.Id}```");
}); });
cgb.CreateCommand(".prune")
.Parameter("num", Discord.Commands.ParameterType.Required)
.Do(async e => {
int num;
if (!Int32.TryParse(e.GetArg("num"), out num) || num < 1) {
await e.Send("Incorrect amount.");
return;
}
(await e.Channel.DownloadMessages(num)).ForEach(async m => await m.Delete());
});
}); });
} }

View File

@ -111,6 +111,7 @@ namespace NadekoBot.Modules {
if (video?.Uri != "" && video.Uri != null) { if (video?.Uri != "" && video.Uri != null) {
SongQueue.Add(video); SongQueue.Add(video);
if(SongQueue.Count > 1)
await e.Send("**Queued** " + video.FullName); await e.Send("**Queued** " + video.FullName);
} }
}); });
@ -171,7 +172,6 @@ namespace NadekoBot.Modules {
var msg = await e.Send("Playing " + Music.CurrentSong.FullName + " [00:00]"); var msg = await e.Send("Playing " + Music.CurrentSong.FullName + " [00:00]");
int counter = 0; int counter = 0;
int byteCount; int byteCount;
var m = await e.Send("Downloading song...");
while ((byteCount = streamer.PCMOutput.Read(buffer, 0, blockSize)) > 0) { while ((byteCount = streamer.PCMOutput.Read(buffer, 0, blockSize)) > 0) {
Voice.Send(buffer, byteCount); Voice.Send(buffer, byteCount);

View File

@ -12,20 +12,24 @@
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl> <IsWebBootstrapper>true</IsWebBootstrapper>
<PublishUrl>C:\Users\Master\Desktop\NadekoBot\</PublishUrl>
<Install>true</Install> <Install>true</Install>
<InstallFrom>Disk</InstallFrom> <InstallFrom>Web</InstallFrom>
<UpdateEnabled>false</UpdateEnabled> <UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode> <UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval> <UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits> <UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically> <UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired> <UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions> <MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision> <InstallUrl>http://www.github.com/Kwoth/NadekoBot/</InstallUrl>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.htm</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@ -47,6 +51,18 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>0BE5B9F3B97B52FC5776E3D046AE0C7F708D2ED5</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>NadekoBot_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="libvideo, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="libvideo, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VideoLibrary.1.3.1\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\libvideo.dll</HintPath> <HintPath>..\packages\VideoLibrary.1.3.1\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\libvideo.dll</HintPath>
@ -112,6 +128,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="NadekoBot_TemporaryKey.pfx" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>