Updated to version 0.5.2

-Fixed issue in which role pings were not recognized
-Added console output of incoming commands for research purposes
  -This information will assist in finding common incorrect usage
  -It will be removed later
This commit is contained in:
Noikoio 2019-04-16 22:22:20 -07:00
parent 76c94c8d59
commit fae8da5511
3 changed files with 10 additions and 5 deletions

View file

@ -131,6 +131,7 @@ Class BirthdayBot
' Don't let this prevent the bot from continuing command execution. ' Don't let this prevent the bot from continuing command execution.
End Try End Try
End If End If
Log("Command", $"{channel.Guild.Name}/{author.Username}#{author.Discriminator}: {msg.Content}")
Await command(csplit, channel, author) Await command(csplit, channel, author)
Catch ex As Exception Catch ex As Exception
If TypeOf ex Is HttpException Then Return If TypeOf ex Is HttpException Then Return

View file

@ -4,8 +4,8 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>BirthdayBot</RootNamespace> <RootNamespace>BirthdayBot</RootNamespace>
<TargetFramework>netcoreapp2.0</TargetFramework> <TargetFramework>netcoreapp2.0</TargetFramework>
<Version>0.5.1</Version> <Version>0.5.2</Version>
<AssemblyVersion>0.5.1.0</AssemblyVersion> <AssemblyVersion>0.5.2.0</AssemblyVersion>
<Authors>Noikoio</Authors> <Authors>Noikoio</Authors>
<Company /> <Company />
<Description>Discord bot for birthday reminders.</Description> <Description>Discord bot for birthday reminders.</Description>

View file

@ -1,4 +1,5 @@
Imports Discord.WebSocket Imports System.Text.RegularExpressions
Imports Discord.WebSocket
Friend Class ManagerCommands Friend Class ManagerCommands
Inherits CommandsCommon Inherits CommandsCommon
@ -58,6 +59,8 @@ Friend Class ManagerCommands
End Function End Function
#Region "Configuration sub-commands" #Region "Configuration sub-commands"
Private Shared ReadOnly RoleMention As New Regex("<@?&(?<snowflake>\d+)>", RegexOptions.Compiled)
' Birthday role set ' Birthday role set
Private Async Function ScmdRole(param As String(), reqChannel As SocketTextChannel) As Task Private Async Function ScmdRole(param As String(), reqChannel As SocketTextChannel) As Task
If param.Length <> 2 Then If param.Length <> 2 Then
@ -70,8 +73,9 @@ Friend Class ManagerCommands
Dim role As SocketRole = Nothing Dim role As SocketRole = Nothing
' Resembles a role mention? Strip it to the pure number ' Resembles a role mention? Strip it to the pure number
If input.StartsWith("<&") And input.EndsWith(">") Then Dim rmatch = RoleMention.Match(input)
input = input.Substring(2, input.Length - 3) If rmatch.Success Then
input = rmatch.Groups("snowflake").Value
End If End If
' Attempt to get role by ID ' Attempt to get role by ID