nonebot / adapter-discord

NoneBot2 Discord 适配器 / Discord adapter for nonebot2
20 stars 8 forks source link

机器人在频道无法使用 #21

Open paul-sama opened 7 months ago

paul-sama commented 7 months ago

机器人开了所有权限,邀请进服务器后,在channels 输入文本消息,机器人无法获取到信息 '_message': [TextSegment(type='text', data={'text': ''})],

CMHopeSunshine commented 7 months ago

刚经测试,如果消息不@Bot的话,Bot收到的消息为空,@Bot了才收到正常的消息,目前不知道是不是 Discord 改动了什么权限。

shininome commented 6 months ago

我今天@bot也收不到消息

Autuamn commented 6 months ago

有没有在 Bot 的设置里打开 MESSAGE CONTENT INTENT image 我不@bot也能收到 content ,不过有时又不行。🤔

log

```python 04-19 11:03:49 [SUCCESS] nonebot | Discord 1208326638673330196 | [GuildMessageCreateEvent]: {'id': 1230715459167453247, 'channel_id': 1208348399263285308, 'author': {'id': 474564749217234954, 'username': 'autuamn_end', 'discriminator': '0', 'global_name': 'Autuamn End', 'avatar': '7a8c1eacb63acfd711543f86244e5572', 'bot': , 'system': , 'mfa_enabled': , 'banner': , 'accent_color': , 'locale': , 'verified': , 'email': , 'flags': , 'premium_type': , 'public_flags': , 'avatar_decoration': }, 'content': '1股份6njfgh', 'timestamp': datetime.datetime(2024, 4, 19, 3, 3, 51, 53000, tzinfo=TzInfo(UTC)), 'edited_timestamp': None, 'tts': False, 'mention_everyone': False, 'mentions': [], 'mention_roles': [], 'mention_channels': , 'attachments': [], 'embeds': [], 'reactions': , 'nonce': '1230715449038077952', 'pinned': False, 'webhook_id': , 'type': , 'activity': , 'application': , 'application_id': , 'message_reference': , 'flags': , 'referenced_message': None, 'interaction': , 'thread': , 'components': [], 'sticker_items': , 'stickers': , 'position': , 'role_subscription_data': , 'guild_id': 1171294052839333910, 'member': {'user': , 'nick': None, 'avatar': None, 'roles': [1180878026678993048, 1181071825208360960, 1181071750851727442, 1180870446959296533], 'joined_at': datetime.datetime(2023, 11, 7, 3, 44, 23, 842000, tzinfo=TzInfo(UTC)), 'premium_since': None, 'deaf': False, 'mute': False, 'flags': , 'pending': False, 'permissions': , 'communication_disabled_until': None}, 'to_me': False, 'reply': None} ```

Shedarshian commented 5 months ago

我也是这样,intent都开了,大部分时候都是必须@才能收到内容,不然content就是空的

测试了一下,可能是机器人必须有缓存才能收到,在刚开启Presence Update这个intent之后,就可以不@就能收到内容,然后重启机器人程序之后就不行了

lmtivy commented 3 months ago

"message_content": true 在配置文件里监听里面加上这一句!整得我都麻了,只有at才能收到信息,加了这一条以后就治好了。