简体   繁体   English

Discord bot上的Heroku MyAnimeList API问题

[英]MyAnimeList api problem with heroku on discord bot

I'm trying to make a Discord bot and I need the api from MyAnimeList.net When I launch the bot on my pc the command works but when I upload the bot to Heroku.com the bot doesn't launch.我正在尝试制作Discord机器人,我需要MyAnimeList.net上的api。在计算机上启动bot时,该命令有效,但是当我将bot上传到Heroku.com时,该bot无法启动。 I have checked everything and the problem comes from this command but I can't find the problem.我已经检查了所有内容,并且问题出自此命令,但我找不到问题。

I also did this in the cmd ($ pip install mal-api) and ($ pip install -U discord.py)我也在cmd($ pip install mal-api)和($ pip install -U discord.py)中做到了这一点

import discord
from discord.ext import commands
import mal
from mal import *


client = commands.Bot(command_prefix = '.')

@client.command()
    async def mal(ctx, *, anime):
    from mal import AnimeSearch
    search = AnimeSearch(anime) 
    await ctx.send(search.results[0].url)

This is how I made the command Please help me这是我发出命令的方式,请帮助我

I'm trying to make a Discord bot and I need the api from MyAnimeList.net When I launch the bot on my pc the command works but when I upload the bot to Heroku.com the bot doesn't launch.我正在尝试制作Discord机器人,我需要MyAnimeList.net上的api。在计算机上启动bot时,该命令有效,但是当我将bot上传到Heroku.com时,该bot无法启动。 I have checked everything and the problem comes from this command but I can't find the problem.我已经检查了所有内容,并且问题出自此命令,但我找不到问题。

I also did this in the cmd ($ pip install mal-api) and ($ pip install -U discord.py)我也在cmd($ pip install mal-api)和($ pip install -U discord.py)中做到了这一点

import discord
from discord.ext import commands
import mal
from mal import *


client = commands.Bot(command_prefix = '.')

@client.command()
    async def mal(ctx, *, anime):
    from mal import AnimeSearch
    search = AnimeSearch(anime) 
    await ctx.send(search.results[0].url)

This is how I made the command Please help me这是我发出命令的方式,请帮助我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM