当我试图将txt文件发送到discord-webhook时,会出现此错误。(蟒蛇3(
import os
import subprocess
import requests
import discord
import dhooks
from dhooks import Webhook, Embed
hook = Webhook("hook")
Discord_txt = open("data.txt", "r+")
hook.send(file=Discord_txt)
根据文档,您应该使用dhooks
:中的File
类
from dhooks import Webhook, File
hook = Webhook("https://discord.com/api/webhooks/...")
Discord_txt = File("data.txt")
hook.send(file=Discord_txt)