def HandleCommand(self, chan, user, cmd, args=None):
		client = self.client._protocol.clientFromUsername(user)
		cmd = cmd.lower()
		
		if chan in self._root.channels:
			channel = self._root.channels[chan]
			access = channel.getAccess(client)
			if cmd == 'info':
				founder = self.client._protocol.clientFromID(channel.owner)
				if founder: founder = 'Founder is <%s>' % founder.username
				else: founder = 'No founder is registered'
				admins = []
				for admin in channel.admins:
					client = self.client._protocol.clientFromID(admin)
					if client: admins.append(client.username)
				users = channel.users
				antispam = 'on' if channel.antispam else 'off'
				if not admins: mods = 'no operators are registered'
				else: mods = '%i registered operator(s) are <%s>' % (len(admins), '>, <'.join(admins))
				if len(users) == 1: users = '1 user is'
				else: users = '%i users are' % len(users)
				return '#%s info: Anti-spam protection is %s. %s, %s. %s currently in the channel.' % (chan, antispam, founder, mods, users)
			elif cmd == 'topic':
				if access in ['mod', 'founder', 'op']:
					args = args or ''
					channel.setTopic(client, args)
					return '#%s: Topic changed' % chan
				else:
					return '#%s: You do not have permission to set the topic' % chan
			elif cmd == 'unregister':
				if access in ['mod', 'founder']:
					channel.owner = ''
					channel.channelMessage('#%s has been unregistered'%chan)
					self.Send('LEAVE %s' % chan)
					return '#%s: Successfully unregistered.' % chan
				else:
					return '#%s: You must contact one of the server moderators or the owner of the channel to unregister a channel' % chan
			elif cmd == 'changefounder':
				if access in ['mod', 'founder']:
					if not args: return '#%s: You must specify a new founder' % chan
					target = self.client._protocol.clientFromUsername(args)
					if not target: return '#%s: cannot assign founder status to a user who does not exist'
					channel.changeFounder(client, target)
					channel.channelMessage('%s Founder has been changed to <%s>' % (chan, args))
					return '#%s: Successfully changed founder to <%s>' % (chan, args)
				else:
					return '#%s: You must contact one of the server moderators or the owner of the channel to change the founder' % chan
			elif cmd == 'spamprotection':
				if access in ['mod', 'founder']:
					if args == 'on':
						channel.antispam = True
						channel.channelMessage('%s Anti-spam protection was enabled by <%s>' % (chan, user))
						return '#%s: Anti-spam protection is on.' % chan
					elif args == 'off':
						channel.antispam = False
						channel.channelMessage('%s Anti-spam protection was disabled by <%s>' % (chan, user))
						return '#%s: Anti-spam protection is off.' % chan
				
				status = 'off'
				if channel.antispam: status = 'on'
				return '#%s: Anti-spam protection is %s' % (chan, status)
			elif cmd == 'op':
				if access in ['mod', 'founder']:
					if not args: return '#%s: You must specify a user to op' % chan
					target = self.client._protocol.clientFromUsername(args)
					if target and channel.isOp(target): return '#%s: <%s> was already an op' % (chan, args)
					channel.opUser(client, target)
				else:
					return '#%s: You do not have permission to op users' % chan
			elif cmd == 'deop':
				if access in ['mod', 'founder']:
					if not args: return '#%s: You must specify a user to deop' % chan
					target = self.client._protocol.clientFromUsername(args)
					if target and not channel.isOp(target): return '#%s: <%s> was not an op' % (chan, args)
					channel.deopUser(client, target)
				else:
					return '#%s: You do not have permission to deop users' % chan
			elif cmd == 'chanmsg':
				if access in ['mod', 'founder', 'op']:
					if not args: return '#%s: You must specify a channel message' % chan
					target = self.client._protocol.clientFromUsername(args)
					if target and channel.isOp(target): args = 'issued by <%s>: %s' % (user, args)
					channel.channelMessage(args)
					return #return '#%s: insert chanmsg here'
				else:
					return '#%s: You do not have permission to issue a channel message' % chan
			elif cmd == 'lock':
				if access in ['mod', 'founder', 'op']:
					if not args: return '#%s: You must specify a channel key to lock a channel' % chan
					channel.setKey(client, args)
					## STUBS ARE BELOW
					return '#%s: Locked' % chan
				else:
					return '#%s: You do not have permission to lock the channel' % chan
			elif cmd == 'unlock':
				if access in ['mod', 'founder', 'op']:
					channel.setKey(client, '*')
					return '#%s: Unlocked' % chan
				else:
					return '#%s: You do not have permission to unlock the channel' % chan
			elif cmd == 'kick':
				if access in ['mod', 'founder', 'op']:
					if not args: return '#%s: You must specify a user to kick from the channel' % chan
					
					if args.count(' '):
						target, reason = args.split(' ', 1)
					else:
						target = args
						reason = None
						
					if target in channel.users:
						target = self.client._protocol.clientFromUsername(target)
						channel.kickUser(client, target, reason)
						return '#%s: <%s> kicked' % (chan, target.username)
					else: return '#%s: <%s> not in channel' % (chan, target)
				else:
					return '#%s: You do not have permission to kick users from the channel' % chan
			elif cmd == 'mute':
				if access in ['mod', 'founder', 'op']:
					if not args: return '#%s: You must specify a user to mute' % chan
					else:
						if args.count(' '): target, duration = args.split(' ', 1)
						else:
							target = args
							duration = -1
					try:
						duration = float(duration)
					except __HOLE__:
						return '#%s: Duration must be an integer!' % chan
					target = self.client._protocol.clientFromUsername(target)
					channel.muteUser(client, target, duration)
				else:
					return '#%s: You do not have permission to mute users' % chan
			elif cmd == 'unmute':
				if access in ['mod', 'founder', 'op']:
					if not args: return '#%s: You must specify a user to unmute' % chan
					target = self.client._protocol.clientFromUsername(args)
					channel.unmuteUser(client, target)
				else:
					return '#%s: You do not have permission to unmute users' % chan
			elif cmd == 'mutelist':
				if channel.mutelist:
					mutelist = dict(channel.mutelist)
					muted = ['#%s: Mute list (%i entries):  '%(chan, len(mutelist))]
					for user in mutelist:
						m = mutelist[user].copy()
						client = self.client._protocol.clientFromID(user)
						if not client:
							del mutelist[user]
							continue
						message = self.client._protocol._format_time(m['expires']) + (' by IP.' if m['ip'] else '.')
						muted.append('%s, %s' % (client.username, message))
					return muted
				else:
					return '#%s: Mute list is empty!' % chan
		
		if cmd == 'register':
			if client.isMod():
				if not args: args = user
				self.Send('JOIN %s' % chan)
				channel = self._root.channels[chan]
				target = self.client._protocol.clientFromUsername(args)
				if target:
					channel.setFounder(client, target)
					return '#%s: Successfully registered to <%s>' % (chan, args.split(' ',1)[0])
				else:
					return '#%s: User <%s> does not exist.' % (chan, args)
			elif not chan in self._root.channels:
				return '#%s: You must contact one of the server moderators or the owner of the channel to register a channel' % chan
		return ''
dataset/ETHPy150Open lunixbochs/uberserver/ChanServ.py/ChanServ.HandleCommand