Skip to content
Snippets Groups Projects
Commit 8ffa9ade authored by Felix Agner's avatar Felix Agner
Browse files

tried adding do-type syntax

parent a8454b01
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,23 @@ end
"""
connectomnibot(ip::IPv4;port::Int)
Also callable with an IPv4 type argument
Connectomnibot is callable with an IPv4 type argument
"""
function connectomnibot(ip::IPv4, port::Int)
return connect(ip,port)
end
"""
connectomnibot(f::Function, args...)
Connectomnibot is callable with `do`-functionality
"""
function connectomnibot(f::Function, args...)
bot = connectomnibot(args...)
try
f(bot)
finally
close(bot)
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment