Last active
July 26, 2020 07:35
-
-
Save vestige/d2cf5b2f4d954f8092183fb6bb461ecb to your computer and use it in GitHub Desktop.
torpc_remote.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import picamera | |
import discord | |
import asyncio | |
client = discord.Client() | |
x = 0 | |
#ここをご自身の環境に書き換えてください。 | |
chid = ここにチャンネルIDを貼り付け | |
token = "ここにBOTトークンを貼り付け" | |
#これ以下は書き換えないでください。 | |
@client.event | |
async def on_ready(): | |
CHANNEL_ID = chid | |
channel = client.get_channel(CHANNEL_ID) | |
await channel.send('参加したよ!') | |
@client.event | |
async def on_message(message): | |
global x | |
if message.content == '写真': | |
with picamera.PiCamera() as camera: | |
camera.resolution = (1920,1080) | |
camera.capture(str(x)+".jpg") | |
CHANNEL_ID = chid | |
channel = client.get_channel(CHANNEL_ID) | |
await channel.send(file=discord.File(str(x)+'.jpg')) | |
x = x + 1 | |
client.run(token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import picamera
import discord
import asyncio
client = discord.Client()
x = 0
#ここをご自身の環境に書き換えてください。
chid = ここにチャンネルIDを貼り付け
token = "ここにBOTトークンを貼り付け"
#これ以下は書き換えないでください。
@client.event
async def on_ready():
CHANNEL_ID = chid
channel = client.get_channel(CHANNEL_ID)
await channel.send('参加したよ!')
@client.event
async def on_message(message):
global x
if message.content == '写真':
with picamera.PiCamera() as camera:
camera.resolution = (1920,1080)
camera.capture(str(x)+".jpg")
CHANNEL_ID = chid
channel = client.get_channel(CHANNEL_ID)
await channel.send(file=discord.File(str(x)+'.jpg'))
x = x + 1
client.run(token)