so im trying to create discord bot from the api you posted but it doesnt seem to be working
import discord
from discord.ext import commands
from hhaven import Client
import m3u8_To_MP4
intents = discord.Intents.default()
intents.typing = False
intents.presences = False
bot = commands.Bot(command_prefix='!', intents=intents)
client = Client()
@bot.event
async def on_ready():
print(f'Logged in as {bot.user.name}')
@bot.command()
async def newest(ctx):
try:
await ctx.send("Fetching newest hentai video...")
results = await client.search("hentai", sort_by="created_at", order="desc", limit=1)
hentai = await results[0].full()
episode = await hentai.episodes[0].full()
m3u8_To_MP4.multithread_download(episode.content)
await ctx.send(f"Downloaded the newest video: {hentai.title} - {episode.name}")
except Exception as e:
traceback.print_exc()
await ctx.send(f"An error occurred: {e}")
bot.run('')