Skip to content

Instantly share code, notes, and snippets.

@jayktaylor
Last active March 17, 2017 15:27
Show Gist options
  • Save jayktaylor/96ae5633dec9ea87c70c48ab191413ed to your computer and use it in GitHub Desktop.
Save jayktaylor/96ae5633dec9ea87c70c48ab191413ed to your computer and use it in GitHub Desktop.
MusicBot - Remove bot from server by ID
async def cmd_leaveserver(self, id):
"""
Usage:
{command_prefix}leaveserver <id>
Removes the bot from a specific server via ID
"""
target = self.get_server(id)
if target is None:
raise exceptions.CommandError('The server {} does not exist'.format(id), expire_in=30)
else:
await self.leave_server(target)
return Response("Left server successfully: {0.name} ({0.id})".format(target))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment