Skip to content

Instantly share code, notes, and snippets.

@UnrealFar
Created July 6, 2022 06:28
Show Gist options
  • Save UnrealFar/b924665c59b073e88e0acaa00d4bb93a to your computer and use it in GitHub Desktop.
Save UnrealFar/b924665c59b073e88e0acaa00d4bb93a to your computer and use it in GitHub Desktop.
Create a one-liner bot with basic commands in Discord.py
os=__import__('os'); discord =__import__('discord'); asy=__import__('asyncio', globals(), locals(), ['coroutine']).coroutine; bot=__import__('discord.ext', globals(), locals(), ['commands']).commands.Bot(command_prefix = '?'); bot.on_ready = asy((lambda: print("Ready!"))); bot.command(name="ping")(asy(lambda ctx: ctx.send(f"Pong! {bot.latency}"))); bot.run(os.environ['Token'])]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment