在vb.net SKYPE4COMLib中检测skype名称

时间:2013-10-08 12:50:26

标签: vb.net

我试图制作skypebot,并且我坚持检测邮件发件人名称

像我试图制作命令一样!帮助管理员。并且只有管理员文本框中的人,他们的名字才能使用它,就像他是命令一样,如果不是那么它就会打印出“无法访问此命令”的内容

    Private Sub skype_MessageStatus(ByVal msg As ChatMessage, ByVal status As TChatMessageStatus)
    Dim Trigger As String = "!"
    Dim BotName As String = "@PandyBot"
    Dim Message As String
    Try

        If status = TChatMessageStatus.cmsReceived Or status = TChatMessageStatus.cmsSent Then
            Message = msg.Body
            If Message.StartsWith(Trigger) Then
                Message = Message.Remove(0, 1)
                msg.Chat.SendMessage(BotName & ": " & ParseMessage(Message))
            End If
        End If


    Catch ex As Exception

    End Try
End Sub

Function ParseMessage(ByVal message As String) As String
    Dim msg As String = "Command not regonized!"
    Select Case message
        Case "test"
            msg = "Is working correctly"
        Case "help"
            msg = "use !help user or !help admin"
        Case "help admin"
            If 
                msg = "!poll, !jail, !murder, !ban"
            Else
                msg = " lol1"
            End If
        Case "help user"
            msg = "!test, !time, !date, !credits, secret"
        Case "date"
            msg = "Current Date is: " & DateTime.Now.ToLongDateString()
        Case "time"
            msg = "Current Time is: " & DateTime.Now.ToLongTimeString()
            Exit Select
    End Select
    Return msg
End Function

那几乎已经完成了。

0 个答案:

没有答案