【问题标题】:MyAnimeList api problem with heroku on discord bot不和谐机器人上的 Heroku 的 MyAnimeList api 问题
【发布时间】:2021-01-25 20:38:42
【问题描述】:

我正在尝试制作一个 Discord 机器人,我需要来自 MyAnimeList.net 的 api 当我在我的电脑上启动该机器人时,该命令有效,但当我将该机器人上传到 Heroku.com 时,该机器人无法启动。我已经检查了所有内容,问题来自这个命令,但我找不到问题。

我也在 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)

这就是我发出命令的方式 请帮帮我

【问题讨论】:

  • 您的 heroku 日志中是否有任何错误消息? (heroku logs --app=app_name 在您的计算机上或转到dashboard.heroku.com/apps/your_app/logs
  • 是的,我有那个pastebin.com/a47h7WkK
  • 您是否尝试将mal 放入requirements.txt 中?
  • 不,我必须穿什么才能穿上它?
  • Ah mais t'es français enfaite, du coup je disais je doit mettre quoi dans le requirements.txt ?

标签: python heroku discord discord.py discord.py-rewrite


【解决方案1】:

你没有令牌 :/ 做 client.run("你的令牌") 这将运行您的代码并向机器人客户端打开它

【讨论】:

  • 请考虑以适当的格式编写答案,并详细说明发生的事情以及如何以良好的方式解决问题。
猜你喜欢
  • 2020-07-20
  • 2022-11-10
  • 2021-03-04
  • 2020-06-08
  • 2020-12-25
  • 1970-01-01
  • 2019-02-26
  • 2019-09-04
  • 1970-01-01
相关资源
最近更新 更多