Skip to content

Instantly share code, notes, and snippets.

@jayktaylor
Last active September 28, 2016 13:42
Show Gist options
  • Save jayktaylor/77d3d5eaa1371c576fb6db4eb6529520 to your computer and use it in GitHub Desktop.
Save jayktaylor/77d3d5eaa1371c576fb6db4eb6529520 to your computer and use it in GitHub Desktop.
Presence changing command
async def c_presence(self, option=None):
"""
Changes your presence on Discord
{prefix}presence <status>
Leave blank to reset presence to online.
"""
afk = False
if option is None:
option = 'online'
else:
option = option.lower()
if any(s == option for s in [e.value for e in discord.Status]):
if option == 'idle':
afk = True
await self.bot.change_presence(status=option, afk=afk)
return Response(":white_check_mark: Set presence to {}!".format(option))
else:
raise InvalidUsage()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment