-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProcessCommands.bas
More file actions
113 lines (80 loc) · 5.75 KB
/
ProcessCommands.bas
File metadata and controls
113 lines (80 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include once "ProcessCommands.bi"
#include once "BotCommands.bi"
#include once "ProcessCtcpPingCommand.bi"
#include once "ProcessFenceCommand.bi"
#include once "ProcessHelpCommand.bi"
#include once "ProcessAsciiGraphicsCommand.bi"
#include once "ProcessChooseFromTwoOptionsCommand.bi"
#include once "ProcessChannelStatisticsCommand.bi"
#include once "ProcessUserWhoIsCommand.bi"
#include once "ProcessTimerCommand.bi"
#include once "ProcessPenisCommand.bi"
#include once "ProcessExecuteCommand.bi"
#include once "ProcessCreateGuidCommand.bi"
#include once "ProcessGetLogsCommand.bi"
Function ValidateAdminLogin( _
ByVal pBot As IrcBot Ptr, _
ByVal UserName As WString Ptr _
)As Boolean
If lstrcmp(UserName, @pBot->AdminNick1) = 0 OrElse lstrcmp(UserName, @pBot->AdminNick2) = 0 Then
If pBot->AdminAuthenticated Then
Return True
End If
End If
Return False
End Function
Function ProcessUserCommand( _
ByVal pBot As IrcBot Ptr, _
ByVal User As WString Ptr, _
ByVal Channel As WString Ptr, _
ByVal MessageText As WString Ptr _
)As Boolean
Dim BotCommand As BotCommands = GetBotCommands(MessageText)
Select Case BotCommand
Case BotCommands.Ping
ProcessCtcpPingCommand(pBot, User, Channel)
Case BotCommands.Help
ProcessHelpCommand(pBot, User, Channel)
Case BotCommands.AsciiGraphics
ProcessAsciiGraphicsCommand(pBot, User, Channel, MessageText)
Case BotCommands.Fence
ProcessFenceCommand(pBot, User, Channel, MessageText)
Case BotCommands.ChooseFromTwoOptions
ProcessChooseFromTwoOptionsCommand(pBot, User, Channel, MessageText)
Case BotCommands.Stats
ProcessChannelStatisticsCommand(pBot, User, Channel)
Case BotCommands.UserWhoIs
ProcessUserWhoIsCommand(pBot, User, Channel)
Case BotCommands.Timer
ProcessTimerCommand(pBot, User, Channel, MessageText)
Case BotCommands.Penis
ProcessPenisCommand(pBot, User, Channel, MessageText)
Case BotCommands.CreateGuid
ProcessCreateGuidCommand(pBot, User, Channel)
Case BotCommands.GetLogs
ProcessGetLogsCommand(pBot, User, Channel)
Case Else
If ValidateAdminLogin(pBot, User) = False Then
Return False
End If
Select Case BotCommand
Case BotCommands.Quit
Case BotCommands.Nick
Case BotCommands.Join
Case BotCommands.Part
Case BotCommands.Topic
Case BotCommands.Say
Case BotCommands.Raw
Case BotCommands.Execute
ProcessExecuteCommand(pBot, User, Channel, MessageText)
Case BotCommands.NickservPassword
Case BotCommands.AddQuestion
Case BotCommands.AddAnswer
Case BotCommands.QuestionList
Case BotCommands.AnswerList
Case Else
Return False
End Select
End Select
Return True
End Function