import discord from discord.ext import tasks from discord.utils import utcnow client = discord.Client() @tasks.loop(minutes=X) async def check_inactive(): last_message_time = None for channel in client.get_all_channels(): if isinstance(channel, discord.TextChannel): async for me...
# 需要导入模块: import discord [as 别名]# 或者: from discord importTextChannel[as 别名]defget_idle_time(cls, channel: discord.TextChannel)-> t.Optional[int]:""" Return the time elapsed, in seconds, since the last message sent in the `channel`. Return None if the channel has no mess...
在创建销售订单时,保存之后,出现如下显示: 点放大镜出现: 出现上面红色错误的时候 怎么解决 解决...
the level up message will be sent in the channel where the member leveled up. You don't have to specify a level up channel ID for each server unless you'd like to.
开发者ID:calebj,项目名称:calebj-cogs,代码行数:18,代码来源:activitylog.py 示例2: get_response ▲点赞 3▼ # 需要导入模块: import discord [as 别名]# 或者: from discord importPrivateChannel[as 别名]defget_response(message, send_typing=True):"""Gets a response. Split up so messages can be...
build(); } @Override public void onMessageReceived(MessageReceivedEvent event) { Message msg = event.getMessage(); if (msg.getContentRaw().equals("!ping")) { MessageChannel channel = event.getChannel(); long time = System.currentTimeMillis(); channel.sendMessage("Pong!") /* => Rest...
1.更新您的Discord库:请确保您使用的是最新版本的Discord库(例如discord.py)。过时版本的库可能存在...
_i_warrior/.local/lib/python3.9/site-packages/discord/webhook/async_.py", line 46, in <module> from ..channel import PartialMessageable ImportError: cannot import name 'PartialMessageable' from 'discord.channel' (/home/quartz_i_warrior/.local/lib/python3.9/site-packages/discord/channel.py) ...
Ignoring exception in on_message Traceback (most recentcalllast):File"C:\Users\Evan\Anaconda3\envs\testing\lib\site-packages\discord\client.py", line270,in_run_event await coro(*args, **kwargs)File"C:/Users/Evan/PycharmProjects/Bot/bot.py", line107,inon_message ...
type, + } + class Channel(Hashable): """Represents a Discord server channel. (注意:这与 discord.py 0.16.7 不同。它可能会略有不同,具体取决于你运行的 discord.py 的版本。) 我必须强调,这充其量只是一种黑客攻击,无法保证它会继续工作多久。此外,无法保证 Discord 不会突然引入一些其他随机 API ...