Skip to content

Commit

Permalink
fix(qq): add leading <at> to GROUP_MESSAGE_CREATE
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 13, 2023
1 parent c650d28 commit 49222c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adapters/qq/src/bot/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class QQGuildBot extends Bot {
super(ctx, config)
this.parent = config.parent
this.parent.guildBot = this
this.platform = 'qq'
this.platform = 'qqguild'
this.internal = new GuildInternal(() => config.parent.guildHttp)
this.http = config.parent.guildHttp
}
Expand Down Expand Up @@ -112,7 +112,7 @@ export class QQGuildBot extends Bot {

async createDirectChannel(id: string, guild_id?: string) {
let input_guild_id = guild_id
if (guild_id.includes('_')) input_guild_id = guild_id.split('_')[0] // call sendPM directly from DM channel
if (guild_id?.includes('_')) input_guild_id = guild_id.split('_')[0] // call sendPM directly from DM channel
const dms = await this.internal.createDMS(id, input_guild_id)
return { id: `${dms.guild_id}_${input_guild_id}`, type: Universal.Channel.Type.DIRECT }
}
Expand Down
1 change: 1 addition & 0 deletions adapters/qq/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export async function adaptSession(bot: QQBot, input: QQ.DispatchPayload) {
session.guildId = session.event.message.guild.id
session.channelId = session.guildId
session.userId = session.event.message.user.id
session.elements.unshift(h.at(session.selfId))
} else if (input.t === 'C2C_MESSAGE_CREATE') {
session.type = 'message'
session.isDirect = true
Expand Down

0 comments on commit 49222c6

Please sign in to comment.