Skip to content

Instantly share code, notes, and snippets.

@Mr-Byte
Last active August 29, 2015 14:03
Show Gist options
  • Save Mr-Byte/dd14ba106a609d50ee93 to your computer and use it in GitHub Desktop.
Save Mr-Byte/dd14ba106a609d50ee93 to your computer and use it in GitHub Desktop.
Imports AW
Module Bot
' Variable to hold a reference to the bot instance.
Dim _instance As Instance
' Variable to hold a reference to avatar add handler.
Dim _avatarAddHandler As InstanceEventHandler
Sub Main()
_instance = New Instance()
' This is how you get the address of an event handler.
_avatarAddHandler = AddressOf AvatarAdd
' Register the handler with the Bot instance
AddHandler _instance.EventAvatarAdd, avatarAddHandler
' Unregister the handler with the Bot instance
RemoveHandler _instance.EventAvatarAdd, avatarAddHandler
End Sub
Sub AvatarAdd(sender As Instance)
' Intentionally left blank for example purposes.
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment