因此,我正在为一个朋友编码一个不和谐的机器人,我需要看看是否在一个特定的频道中发送了一条消息。我试了几件事,问了几个人,并寻找答案,但我找不到任何答案。这是我得到的最接近的,我试着改变了几个对象:
if message.channelID == ('#858884357271322634'):
await message.channel.send ('I checked and verified the channel.')
我正在使用pubnub进行聊天,并使用userid作为发送消息的通道,但是当我想检索两个用户之间的对话时,我需要从两个渠道获取数据,我如何做到这一点?
我在两个频道上都有数据,例如"userAid“和"userBid”,但是如果我查询
this.pubnub.history(
{ channel: ['userAid,'userBid'], reverse: true, count: 15 },
(status, res) => {
});```
it does not ret
我对我的不和谐机器人的这段代码有困难,它应该检测到一个人在玩某个特定的游戏,然后在一个频道中发送一条消息,但它既不检测也不发送。
到目前为止,我的代码如下:
@client.event
async def get_all_members(channel):
games = ["osu!"]
#add code later to make ping work
if channel.activity and channel.activity.name.lower() in games:
channel;client.get.channel(
我试图从用户那里得到一条消息,然后将其发送到特定的文本频道。信息应嵌入其中。但是我不喜欢当您有一堆字段时,我希望discord.Embed()中的描述保存文本内容。但是它给了我一个错误TypeError: Object of type Message is not JSON serializable
这是我的密码:
class Changelog(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_r
我设置了一个日志频道,如果用户删除了一条消息,它就会被发送到该频道,这样我的版主和我自己就可以看到被删除的消息。 @client.event
async def on_message_delete(message):
if not message.author.bot:
embed = Embed(title = "[❌] A message has been deleted by a user.",
description = f"{message.author.display_name} (`{m