|
@@ -95,14 +95,14 @@ export interface DefaultEventInterface {
|
|
* All events inherit this.
|
|
* All events inherit this.
|
|
*/
|
|
*/
|
|
export class EventBuilder {
|
|
export class EventBuilder {
|
|
- chats?: EntityLike[];
|
|
|
|
|
|
+ chats?: string[];
|
|
blacklistChats: boolean;
|
|
blacklistChats: boolean;
|
|
resolved: boolean;
|
|
resolved: boolean;
|
|
func?: CallableFunction;
|
|
func?: CallableFunction;
|
|
client?: TelegramClient;
|
|
client?: TelegramClient;
|
|
|
|
|
|
constructor(eventParams: DefaultEventInterface) {
|
|
constructor(eventParams: DefaultEventInterface) {
|
|
- this.chats = eventParams.chats;
|
|
|
|
|
|
+ this.chats = eventParams.chats?.map((x)=>x.toString());
|
|
this.blacklistChats = eventParams.blacklistChats || false;
|
|
this.blacklistChats = eventParams.blacklistChats || false;
|
|
this.resolved = false;
|
|
this.resolved = false;
|
|
this.func = eventParams.func;
|
|
this.func = eventParams.func;
|
|
@@ -138,7 +138,7 @@ export class EventBuilder {
|
|
if (event.chatId == undefined) {
|
|
if (event.chatId == undefined) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- const inside = this.chats.includes(event.chatId);
|
|
|
|
|
|
+ const inside = this.chats.includes(event.chatId.toString());
|
|
if (inside == this.blacklistChats) {
|
|
if (inside == this.blacklistChats) {
|
|
// If this chat matches but it's a blacklist ignore.
|
|
// If this chat matches but it's a blacklist ignore.
|
|
// If it doesn't match but it's a whitelist ignore.
|
|
// If it doesn't match but it's a whitelist ignore.
|