'Performs the \'/events\' operation, dumping the events that we\'ve received
belonging to the given types. If no types are specified then this provides
all buffered events.
If the user runs \'/events clear\' then this clears the list of events we\'ve
received.'

def do_events(self, arg):

    event_types = arg.upper().split()
    if ('CLEAR' in event_types):
        del self._received_events[:]
        return format('cleared    event    backlog', *STANDARD_OUTPUT)
    return '\n'.join([format(str(e), *STANDARD_OUTPUT) for e in self.get_events(*event_types)])
