diff --git a/.gitignore b/.gitignore index 5180b0a..ca43968 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ packages *.swp Makefile .idea +.vs +data +app.config diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 9bbdc31..3f2b8c6 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -6,8 +6,11 @@ using System.Reflection; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("© 2016 Project Golan")] +[assembly: AssemblyCopyright("© 2016-2017 Project Golan")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: CLSCompliant(false)] -[assembly: AssemblyVersion("3.1.*")] +[assembly: AssemblyVersion("3.2.*")] + +// EOF + diff --git a/README.md b/README.md index 4f62128..9864884 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,2 @@ vrobot3 is a chat bot for IRC and Discord. - -Modules include: -- `Mod_Admin`: Administrative commands. -- `Mod_Audio`: Commands for servers that support audio. -- `Mod_Fun`: :^) -- `Mod_Idgames`: Commands for searching the /idgames archive. -- `Mod_Links`: URI preview handling. -- `Mod_Memo`: Memo server for leaving notes at people. -- `Mod_Quote`: Doominati QDB commands. -- `Mod_Seen`: Commands for checking the last time someone was online. -- `Mod_Shittalk`: I blame Yholl -- `Mod_Utils`: Utilities that are generally useful. +Includes modules for bot administration, useful utilities like memos, and more. diff --git a/Source/Utils.cs b/Source/Utils.cs index 584abf7..95fb051 100644 --- a/Source/Utils.cs +++ b/Source/Utils.cs @@ -82,22 +82,15 @@ namespace ProjectGolan.Vrobot3 if(span.Seconds == 0) return "now"; - var denom = span.Days > 0 ? "day" : - span.Hours > 0 ? "hour" : - span.Minutes > 0 ? "minute" : - "second"; - + String denom; int number; - switch(denom) - { - default: number = 0; break; - case "second": number = span.Seconds; break; - case "minute": number = span.Minutes; break; - case "hour": number = span.Hours; break; - case "day": number = span.Days; break; - } - return $"{number} {denom}{number != 1 ? "s" : String.Empty} ago"; + if(span.Days > 0) {denom = "day"; number = span.Days;} + else if(span.Hours > 0) {denom = "hour"; number = span.Hours;} + else if(span.Minutes > 0) {denom = "minute"; number = span.Minutes;} + else {denom = "second"; number = span.Seconds;} + + return $"{number} {denom}{(number != 1 ? "s" : String.Empty)} ago"; } // diff --git a/packages.config b/packages.config index 77f5a49..8b4513e 100644 --- a/packages.config +++ b/packages.config @@ -1,11 +1,15 @@ - + - + + + + - + + diff --git a/vrobot3.csproj b/vrobot3.csproj index 753c978..7e6b4b5 100644 --- a/vrobot3.csproj +++ b/vrobot3.csproj @@ -47,7 +47,7 @@ packages/HtmlAgilityPack.1.4.9.5/lib/Net45/HtmlAgilityPack.dll - packages/Newtonsoft.Json.9.0.2-beta1/lib/net45/Newtonsoft.Json.dll + packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll packages/NtpDateTime.1.0.8/lib/NtpDateTime.dll diff --git a/vrobot3.sln b/vrobot3.sln index 1b0de95..6f09170 100644 --- a/vrobot3.sln +++ b/vrobot3.sln @@ -1,174 +1,22 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vrobot3", "vrobot3.csproj", "{83337FF3-3334-42EC-824D-532FF0C973A9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|AnyCPU = Debug|AnyCPU - Release|AnyCPU = Release|AnyCPU + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {83337FF3-3334-42EC-824D-532FF0C973A9}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU - {83337FF3-3334-42EC-824D-532FF0C973A9}.Debug|AnyCPU.Build.0 = Debug|AnyCPU - {83337FF3-3334-42EC-824D-532FF0C973A9}.Release|AnyCPU.ActiveCfg = Release|AnyCPU - {83337FF3-3334-42EC-824D-532FF0C973A9}.Release|AnyCPU.Build.0 = Release|AnyCPU + {83337FF3-3334-42EC-824D-532FF0C973A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83337FF3-3334-42EC-824D-532FF0C973A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83337FF3-3334-42EC-824D-532FF0C973A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83337FF3-3334-42EC-824D-532FF0C973A9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - Policies = $0 - $0.DotNetNamingPolicy = $1 - $1.DirectoryNamespaceAssociation = None - $1.ResourceNamePolicy = FileFormatDefault - $0.NameConventionPolicy = $2 - $2.Rules = $3 - $3.NamingRule = $4 - $4.Name = Namespaces - $4.AffectedEntity = Namespace - $4.VisibilityMask = VisibilityMask - $4.NamingStyle = PascalCase - $4.IncludeInstanceMembers = True - $4.IncludeStaticEntities = True - $3.NamingRule = $5 - $5.Name = Types - $5.AffectedEntity = Class, Struct, Enum, Delegate - $5.VisibilityMask = VisibilityMask - $5.NamingStyle = PascalCase - $5.IncludeInstanceMembers = True - $5.IncludeStaticEntities = True - $3.NamingRule = $6 - $6.Name = Interfaces - $6.RequiredPrefixes = $7 - $7.String = I - $6.AffectedEntity = Interface - $6.VisibilityMask = VisibilityMask - $6.NamingStyle = PascalCase - $6.IncludeInstanceMembers = True - $6.IncludeStaticEntities = True - $3.NamingRule = $8 - $8.Name = Attributes - $8.RequiredSuffixes = $9 - $9.String = Attribute - $8.AffectedEntity = CustomAttributes - $8.VisibilityMask = VisibilityMask - $8.NamingStyle = PascalCase - $8.IncludeInstanceMembers = True - $8.IncludeStaticEntities = True - $3.NamingRule = $10 - $10.Name = Event Arguments - $10.RequiredSuffixes = $11 - $11.String = EventArgs - $10.AffectedEntity = CustomEventArgs - $10.VisibilityMask = VisibilityMask - $10.NamingStyle = PascalCase - $10.IncludeInstanceMembers = True - $10.IncludeStaticEntities = True - $3.NamingRule = $12 - $12.Name = Exceptions - $12.RequiredSuffixes = $13 - $13.String = Exception - $12.AffectedEntity = CustomExceptions - $12.VisibilityMask = VisibilityMask - $12.NamingStyle = PascalCase - $12.IncludeInstanceMembers = True - $12.IncludeStaticEntities = True - $3.NamingRule = $14 - $14.Name = Methods - $14.AffectedEntity = Methods - $14.VisibilityMask = VisibilityMask - $14.NamingStyle = PascalCase - $14.IncludeInstanceMembers = True - $14.IncludeStaticEntities = True - $3.NamingRule = $15 - $15.Name = Static Readonly Fields - $15.AffectedEntity = ReadonlyField - $15.VisibilityMask = Internal, Protected, Public - $15.NamingStyle = PascalCase - $15.IncludeInstanceMembers = False - $15.IncludeStaticEntities = True - $3.NamingRule = $16 - $16.Name = Fields (Non Private) - $16.AffectedEntity = Field - $16.VisibilityMask = Internal, Protected, Public - $16.NamingStyle = PascalCase - $16.IncludeInstanceMembers = True - $16.IncludeStaticEntities = True - $3.NamingRule = $17 - $17.Name = ReadOnly Fields (Non Private) - $17.AffectedEntity = ReadonlyField - $17.VisibilityMask = Internal, Protected, Public - $17.NamingStyle = PascalCase - $17.IncludeInstanceMembers = True - $17.IncludeStaticEntities = False - $3.NamingRule = $18 - $18.Name = Fields (Private) - $18.AllowedPrefixes = $19 - $19.String = _ - $19.String = m_ - $18.AffectedEntity = Field, ReadonlyField - $18.VisibilityMask = Private - $18.NamingStyle = AllLower - $18.IncludeInstanceMembers = True - $18.IncludeStaticEntities = False - $3.NamingRule = $20 - $20.Name = Static Fields (Private) - $20.AffectedEntity = Field - $20.VisibilityMask = Private - $20.NamingStyle = AllLower - $20.IncludeInstanceMembers = False - $20.IncludeStaticEntities = True - $3.NamingRule = $21 - $21.Name = ReadOnly Fields (Private) - $21.AllowedPrefixes = $22 - $22.String = _ - $22.String = m_ - $21.AffectedEntity = ReadonlyField - $21.VisibilityMask = Private - $21.NamingStyle = AllLower - $21.IncludeInstanceMembers = True - $21.IncludeStaticEntities = False - $3.NamingRule = $23 - $23.Name = Constant Fields - $23.AffectedEntity = ConstantField - $23.VisibilityMask = VisibilityMask - $23.NamingStyle = PascalCase - $23.IncludeInstanceMembers = True - $23.IncludeStaticEntities = True - $3.NamingRule = $24 - $24.Name = Properties - $24.AffectedEntity = Property - $24.VisibilityMask = VisibilityMask - $24.NamingStyle = PascalCase - $24.IncludeInstanceMembers = True - $24.IncludeStaticEntities = True - $3.NamingRule = $25 - $25.Name = Events - $25.AffectedEntity = Event - $25.VisibilityMask = VisibilityMask - $25.NamingStyle = PascalCase - $25.IncludeInstanceMembers = True - $25.IncludeStaticEntities = True - $3.NamingRule = $26 - $26.Name = Enum Members - $26.AffectedEntity = EnumMember - $26.VisibilityMask = VisibilityMask - $26.NamingStyle = PascalCase - $26.IncludeInstanceMembers = True - $26.IncludeStaticEntities = True - $3.NamingRule = $27 - $27.Name = Parameters - $27.AffectedEntity = Parameter - $27.VisibilityMask = VisibilityMask - $27.NamingStyle = AllLower - $27.IncludeInstanceMembers = True - $27.IncludeStaticEntities = True - $3.NamingRule = $28 - $28.Name = Type Parameters - $28.RequiredPrefixes = $29 - $29.String = T - $28.AffectedEntity = TypeParameter - $28.VisibilityMask = VisibilityMask - $28.NamingStyle = PascalCase - $28.IncludeInstanceMembers = True - $28.IncludeStaticEntities = True + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal