出ているエラーコード
今の所なし
main.py
import discord import logging import abc import requests from discord.ext import tasks, commands import aiohttp from pprint import pprint import asyncio from datetime import datetime import json import typing from os import getenv import traceback discord_intents = discord.Intents.all() 問題はここだと思います -------------------------------------------------------------------------------------- bot = commands.Bot(command_prefix='.', description='A bot that greets the user back.') bot.remove_command("help") @bot.command() async def test(ctx): pass @bot.command() async def on_ready(): pass async def my_message(message): pass async def on_message(message): pass @bot.command() async def foo(ctx, arg): await ctx.send(arg) @bot.command() async def add(ctx, arg): await ctx.send(arg) @bot.command() async def _list(ctx, arg): await ctx.send(arg) ------------------------------------------------------------------------------------- class LibeClient(discord.Client): async def on_ready(self): print('--------------------------------------') print('Logged on as {0}!'.format(self.user)) print('Logged in as') print(self.user.name) print(self.user.id) print('ログインしました。') print('--------------------------------------') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.counter = 0 async def on_message(self, message): print('メッセージが来たよ→ {0.author}: {0.content}'.format(message)) if message.content.startswith('/id'): await message.channel.send('PaL_Libe') if message.content.startswith('logout'): await message.channel.send('ログアウトします。') await client.logout() if message.content == '!bot': await message.channel.send('```BOT discordバージョン起動中です。```') if message.content.startswith('Hi'): await message.channel.send(message.author.mention + 'hello') client = LibeClient() client.run('TOKEN')
回答1件
あなたの回答
tips
プレビュー