Skip to content

Commit 0365beb

Browse files
committed
add conversation type
1 parent 46fe372 commit 0365beb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/plugins/pole.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class PolePlugin extends PluginBase {
122122
if (String(msg.sender.id).startsWith('-100')) {
123123
return;
124124
}
125-
if (!String(msg.conversation.id).startsWith('-')) {
125+
if (!String(msg.conversation.id).startsWith('-') || msg.conversation.type !== 'group') {
126126
return this.bot.replyMessage(msg, this.bot.errors.groupOnly);
127127
}
128128
if (await hasTag(this.bot, msg.conversation.id, 'nopole')) {

src/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ export class User {
138138
export class Conversation {
139139
id: number | string;
140140
title: string;
141+
type: ConversationType;
141142

142-
constructor(id: number | string, title?: string) {
143+
constructor(id: number | string, title?: string, type?: ConversationType) {
143144
this.id = id;
144145
this.title = title;
146+
this.type = type;
145147
}
146148
}
147149

150+
type ConversationType = 'private' | 'group' | 'channel';
151+
148152
export class ConversationInfo extends Conversation {}
149153

150154
export class Message {

0 commit comments

Comments
 (0)