Closed TheReverend403 closed 9 years ago
Like this?
Kick method needs to have this signature, since we want to stay backwards-compatible, and sometimes, you probably don't want to provide a reason in your code.
def kick(self, reason=None):
I'm not too sure about the line break before the formatting arguments, but I think this is what you had in mind.
Maybe consider
def kick(self, reason=None):
postfix = ': %s' % reason if reason is not None else ''
self.send_chat('You have been kicked%s' % postfix)
self.server.send_chat('%s has been kicked%s' % (self.name, postfix))
self.disconnect()
:)
:thumbsup:
CubeWorldConnection.kick should definitely not take a varg argument. Do the ' '.join in the command itself, and make the reason argument optional in CubeWorldConnection.kick (default None).