diff --git a/BirthdayBot/BirthdayBot.vb b/BirthdayBot/BirthdayBot.vb
index be46799..d32d2fc 100644
--- a/BirthdayBot/BirthdayBot.vb
+++ b/BirthdayBot/BirthdayBot.vb
@@ -131,6 +131,7 @@ Class BirthdayBot
' Don't let this prevent the bot from continuing command execution.
End Try
End If
+ Log("Command", $"{channel.Guild.Name}/{author.Username}#{author.Discriminator}: {msg.Content}")
Await command(csplit, channel, author)
Catch ex As Exception
If TypeOf ex Is HttpException Then Return
diff --git a/BirthdayBot/BirthdayBot.vbproj b/BirthdayBot/BirthdayBot.vbproj
index 288942c..e083c66 100644
--- a/BirthdayBot/BirthdayBot.vbproj
+++ b/BirthdayBot/BirthdayBot.vbproj
@@ -4,8 +4,8 @@
Exe
BirthdayBot
netcoreapp2.0
- 0.5.1
- 0.5.1.0
+ 0.5.2
+ 0.5.2.0
Noikoio
Discord bot for birthday reminders.
diff --git a/BirthdayBot/UserInterface/ManagerCommands.vb b/BirthdayBot/UserInterface/ManagerCommands.vb
index 0767b70..2435aa4 100644
--- a/BirthdayBot/UserInterface/ManagerCommands.vb
+++ b/BirthdayBot/UserInterface/ManagerCommands.vb
@@ -1,4 +1,5 @@
-Imports Discord.WebSocket
+Imports System.Text.RegularExpressions
+Imports Discord.WebSocket
Friend Class ManagerCommands
Inherits CommandsCommon
@@ -58,6 +59,8 @@ Friend Class ManagerCommands
End Function
#Region "Configuration sub-commands"
+ Private Shared ReadOnly RoleMention As New Regex("<@?&(?\d+)>", RegexOptions.Compiled)
+
' Birthday role set
Private Async Function ScmdRole(param As String(), reqChannel As SocketTextChannel) As Task
If param.Length <> 2 Then
@@ -70,8 +73,9 @@ Friend Class ManagerCommands
Dim role As SocketRole = Nothing
' Resembles a role mention? Strip it to the pure number
- If input.StartsWith("<&") And input.EndsWith(">") Then
- input = input.Substring(2, input.Length - 3)
+ Dim rmatch = RoleMention.Match(input)
+ If rmatch.Success Then
+ input = rmatch.Groups("snowflake").Value
End If
' Attempt to get role by ID