Further implementation of nested functions in interactions, including in consent module
This commit is contained in:
@@ -41,12 +41,16 @@ end
|
||||
-- ============================
|
||||
-- interact function for the consent module
|
||||
function modpol.modules.consent:interact(user)
|
||||
local resp = modpol.interactions.binary_poll_user(user, "How do you vote?")
|
||||
if resp == 'yes' then
|
||||
self:approve(user, true)
|
||||
elseif resp == 'no' then
|
||||
self:approve(user, false)
|
||||
end
|
||||
-- TODO this needs more context on the vote at hand
|
||||
modpol.interactions.binary_poll_user(
|
||||
user, "How do you vote?",
|
||||
function(vote)
|
||||
if vote == 'yes' then
|
||||
self:approve(user, true)
|
||||
elseif vote == 'no' then
|
||||
self:approve(user, false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- =========================================
|
||||
@@ -100,4 +104,4 @@ function modpol.modules.consent:update_status()
|
||||
else
|
||||
modpol.ocutil.log('Waiting for more votes...')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user