Skip to content

Commit ec4fdff

Browse files
Restrict temp users from writing to mainchat
* Show error when temp users write to mainchat. * Don't maintain history for messages to mainchat by temp users.
1 parent 8e8c191 commit ec4fdff

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

chatlogger.lua

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ local tConfig, tChatHistory = {
1414
sTimeFormat = "[%I:%M:%S %p] ",
1515
sPath = Core.GetPtokaXPath().."scripts/texts/",
1616
iMaxLines = 100,
17+
iTempProfile = 6,
1718
}, { "Hi!" }
1819
local tTickers = {
1920
tTopics = {},
@@ -80,6 +81,7 @@ function OnTimer( iTimerID )
8081
end
8182

8283
function AddHistory( tUser, sInput, bIsCommand )
84+
if tUser.iProfile == tConfig.iTempProfile then return false end
8385
local sChatLine = os.date( tConfig.sTimeFormat )..sInput
8486
if not( bIsCommand and tConfig.sProfiles:find(tUser.iProfile) ) then
8587
table.insert( tChatHistory, sChatLine )

external/restrict/chat.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function RestrictChat( sBotName, Error )
1111
local sError = ( "<%s> %s" ):format( sBotName, Error("gen", 2) )
1212
return function( tUser, sMessage, bFlag )
1313
if not bFlag then return bFlag end
14-
if tUser.iProfile == -1 then
14+
if tUser.iProfile == -1 or tUser.iProfile == 6 then
1515
Core.SendToUser( tUser, sError )
1616
return true
1717
end

0 commit comments

Comments
 (0)