【发布时间】:2020-06-16 19:46:07
【问题描述】:
我希望我的 discord.py 机器人通过 PRAW 从 r/memes 的热门帖子中发送 meme。在这个问题之后,我尝试在网络和文档中搜索,但我没有找到任何查看图像的方法。这是我的代码:
import praw
import discord
from discord.ext import commands
from discord import client
reddit = praw.Reddit(client_id="d",
client_secret="d",
user_agent="automoderatoredj by /u/taskuratik")
#boot
print("il bot si sta avviando... ")
token = "token"
client = commands.Bot(command_prefix=("/"))
#bot online
@client.event
async def on_ready():
print("il bot e' ora online")
@client.command()
async def meme(submission):
if reddit:
channel = client.get_channel(722491234991472742)
submission = reddit.subreddit("memes").hot(limit=1)
await channel.send(submission.url)
client.run(token)
【问题讨论】:
-
有人可以删除客户端 ID 和密码吗?
标签: python-3.x discord.py praw