Skip to content

Instantly share code, notes, and snippets.

@castrix
Created August 19, 2025 06:09
Show Gist options
  • Save castrix/3f08e979ee31b5e4e57d06ac99065a4b to your computer and use it in GitHub Desktop.
Save castrix/3f08e979ee31b5e4e57d06ac99065a4b to your computer and use it in GitHub Desktop.
bot dc
import os
import discord
TOKEN = "YOUR_DISCORD_BOT_TOKEN" # replace with your bot token
CHANNEL_ID = 123456789012345678 # replace with your channel ID
COMMAND = "!screenshot" # type this in Discord to trigger
intents = discord.Intents.default()
intents.message_content = True # needed to read messages
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f"✅ Logged in as {client.user}")
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.strip().lower() == COMMAND:
screenshot_path = "/sdcard/screen.png"
os.system(f"screencap -p {screenshot_path}")
await message.channel.send(file=discord.File(screenshot_path))
client.run(TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment