# Path: halibot/halmodule.py
# class HalModule(HalObject):
# 
# 	def reply(self, msg0=None, **kwargs):
# 		# Create the reply message
# 		body = kwargs.get('body', msg0.body)
# 		mtype = kwargs.get('type', msg0.type)
# 		author = kwargs.get('author', msg0.author)
# 		origin = kwargs.get('origin', self.name)
# 
# 		msg = Message(body=body, type=mtype, author=author, origin=origin)
# 
# 		# Synchronous reply?
# 		if msg0.sync:
# 			self.sync_replies[msg0.uuid].append(msg)
# 		else:
# 			self.send_to(msg, [ msg0.origin ])
# 
# 	def hasPermission(self, msg, perm):
# 		return self._hal.auth.hasPermission(msg.origin, msg.identity, perm)
# 
# Path: halibot/message.py
# class Message():
# 
# 	def __init__(self, **kwargs):
# 		self.log = logging.getLogger(self.__class__.__name__)
# 		self.uuid = uuid.uuid4()
# 		self.sync = False
# 
# 		self.body = kwargs.get('body', None)
# 		self.type = kwargs.get('type', 'simple')
# 		self.author = kwargs.get('author', None)
# 		self.identity = kwargs.get('identity', None)
# 		self.origin = kwargs.get('origin', None)
# 		self.misc = kwargs.get('misc', jsdict())
# 		self.target = kwargs.get('target', '')
# 
# 	def whom(self):
# 		return '/'.join(self.target.split('/')[1:])
# 
# 	def __repr__(self):
# 		return "halibot.Message(body='{}', type='{}', author='{}', identity='{}', origin='{}', misc='{}', target='{}')".format(self.body, self.type, self.author, self.identity, self.origin, self.misc, self.target)
# 
# 	def __str__(self):
# 		return "body='{}' type='{}' author='{}' origin='{}' target='{}'".format(self.body, self.type, self.author, self.origin, self.target)


from halibot import HalModule, Message
#
# Hello World reference Halibot Module
#  Replies to any message starting with "!hello"
#

# Hello Module
#  Upon receiving a message from any source, checks if the body of that message
#  starts with the literal string "!quote"
#  If so, responds with "Hello World!" via the same way the message was received
class Hello(HalModule):

	# Module version strings
	#  These should be defined so that Halibot can safety-check modules prior to
	#  loading that may use unimplemented or deprecated features
	#  VERSION - what is the version of this module (for reference), using semver.
	#  HAL_MINIMUM - minimum version of Halibot core that this module will work with
	#  HAL_MAXIMUM - (optional) reject Halibot core versions newer than this.

	VERSION = "1.0.0"
	HAL_MINIMUM = "0.1"

	# Called when the module is initialized
	#  Put any initialization logic here, instead of __init__()
	#  In this case, no initialization is needed, thus it is a no-op
	#  This is already defined in HalModule, so it can be excluded if not needed

# Path: halibot/halmodule.py
# class HalModule(HalObject):
# 
# 	def reply(self, msg0=None, **kwargs):
# 		# Create the reply message
# 		body = kwargs.get('body', msg0.body)
# 		mtype = kwargs.get('type', msg0.type)
# 		author = kwargs.get('author', msg0.author)
# 		origin = kwargs.get('origin', self.name)
# 
# 		msg = Message(body=body, type=mtype, author=author, origin=origin)
# 
# 		# Synchronous reply?
# 		if msg0.sync:
# 			self.sync_replies[msg0.uuid].append(msg)
# 		else:
# 			self.send_to(msg, [ msg0.origin ])
# 
# 	def hasPermission(self, msg, perm):
# 		return self._hal.auth.hasPermission(msg.origin, msg.identity, perm)
# 
# Path: halibot/message.py
# class Message():
# 
# 	def __init__(self, **kwargs):
# 		self.log = logging.getLogger(self.__class__.__name__)
# 		self.uuid = uuid.uuid4()
# 		self.sync = False
# 
# 		self.body = kwargs.get('body', None)
# 		self.type = kwargs.get('type', 'simple')
# 		self.author = kwargs.get('author', None)
# 		self.identity = kwargs.get('identity', None)
# 		self.origin = kwargs.get('origin', None)
# 		self.misc = kwargs.get('misc', jsdict())
# 		self.target = kwargs.get('target', '')
# 
# 	def whom(self):
# 		return '/'.join(self.target.split('/')[1:])
# 
# 	def __repr__(self):
# 		return "halibot.Message(body='{}', type='{}', author='{}', identity='{}', origin='{}', misc='{}', target='{}')".format(self.body, self.type, self.author, self.identity, self.origin, self.misc, self.target)
# 
# 	def __str__(self):
# 		return "body='{}' type='{}' author='{}' origin='{}' target='{}'".format(self.body, self.type, self.author, self.origin, self.target)


# Path: packages/hello/hello.py
from halibot import HalModule, Message

#
# Hello World reference Halibot Module
#  Replies to any message starting with "!hello"
#

# Hello Module
#  Upon receiving a message from any source, checks if the body of that message
#  starts with the literal string "!quote"
#  If so, responds with "Hello World!" via the same way the message was received
class Hello(HalModule):

	# Module version strings
	#  These should be defined so that Halibot can safety-check modules prior to
	#  loading that may use unimplemented or deprecated features
	#  VERSION - what is the version of this module (for reference), using semver.
	#  HAL_MINIMUM - minimum version of Halibot core that this module will work with
	#  HAL_MAXIMUM - (optional) reject Halibot core versions newer than this.

	VERSION = "1.0.0"
	HAL_MINIMUM = "0.1"

	# Called when the module is initialized
	#  Put any initialization logic here, instead of __init__()
	#  In this case, no initialization is needed, thus it is a no-op
	#  This is already defined in HalModule, so it can be excluded if not needed

	def init(self):