Skip to content

Instantly share code, notes, and snippets.

@cyrus01337
Created February 11, 2021 12:31
Show Gist options
  • Save cyrus01337/9723838bdee80e001ed410fced1020cd to your computer and use it in GitHub Desktop.
Save cyrus01337/9723838bdee80e001ed410fced1020cd to your computer and use it in GitHub Desktop.
Context Shortcuts for DIscord.py
Format:
Attribute == Shortcut
Attribute ~~ Shortcut (can be equal to)
Guild.me == ctx.me (Gives ClientUser in DMs)
Command.cog == ctx.cog
Message.guild == ctx.guild (Gives None in DMs)
commands.Bot() == ctx.bot
Message.author == ctx.author (Gives User in DMs)
Message.channel == ctx.channel
Guild.voice_client == ctx.voice_client
Message.reply(...) == ctx.reply(...)
Message.channel.pins() == ctx.pins()
Message.channel.typing() == ctx.typing()
Message.channel.send(...) == ctx.send(...)
abc.Messageable.history(...) == ctx.history(...)
Message.channel.trigger_typing() == ctx.trigger_typing()
Message.channel.fetch_message(...) == ctx.fetch_message(...)
Bot.get_command(...) ~~ ctx.command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment