HiveLang
Conditionals
Control the flow of your bot with if/else statements.
Basic If Statement
Use if to execute code based on a condition.
basic-if.hive
bot "Helper"
on input
if input contains "help"
say "I can help you with coding, research, or scheduling."
end
end
endIf/Else
Add an else block for alternative behavior.
if-else.hive
bot "Greeter"
on input
if input contains "morning"
say "Good morning! How can I help?"
else
say "Hello! What would you like to do?"
end
end
endMultiple Conditions
Combine conditions using or and and operators.
multi-condition.hive
bot "Router"
on input
if input contains "code" or input contains "program"
delegate to CodingAgent
end
if input contains "urgent" and input contains "email"
call messaging.email.send(to: "team@bothive.cloud", subject: "Urgent")
end
end
endComparison Operators
HiveLang supports standard comparison operators:
==— Equal to!=— Not equal to>— Greater than<— Less thancontains— String contains substring