add reject
This commit is contained in:
parent
041266846d
commit
b4f6300a23
@ -2,7 +2,7 @@
|
|||||||
"main": "plugin.js",
|
"main": "plugin.js",
|
||||||
"name": "discord",
|
"name": "discord",
|
||||||
"description": "Discord Service for Squeebot 3",
|
"description": "Discord Service for Squeebot 3",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"tags": ["service", "discord"],
|
"tags": ["service", "discord"],
|
||||||
"dependencies": ["control?"],
|
"dependencies": ["control?"],
|
||||||
"npmDependencies": ["discord.js@^12.5.1"]
|
"npmDependencies": ["discord.js@^12.5.1"]
|
||||||
|
@ -56,6 +56,11 @@ class DiscordMessageAdapter implements IMessage {
|
|||||||
this.source.resolve(this, ...args);
|
this.source.resolve(this, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public reject(error: Error): void {
|
||||||
|
this.resolved = true;
|
||||||
|
this.source.resolve(this, error.message);
|
||||||
|
}
|
||||||
|
|
||||||
public mention(user: IMessageTarget): string {
|
public mention(user: IMessageTarget): string {
|
||||||
return `<@${user.id}>`;
|
return `<@${user.id}>`;
|
||||||
}
|
}
|
||||||
@ -128,7 +133,7 @@ class DiscordProtocol extends Protocol {
|
|||||||
member,
|
member,
|
||||||
this,
|
this,
|
||||||
{ id: member.user.id, name: member.user.username },
|
{ id: member.user.id, name: member.user.username },
|
||||||
{ server: member.guild.id, id: '', name: ''});
|
{ server: member.guild.id, id: '*', name: '*'});
|
||||||
this.plugin.stream.emitTo('channel', 'event', newMessage);
|
this.plugin.stream.emitTo('channel', 'event', newMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -144,7 +149,7 @@ class DiscordProtocol extends Protocol {
|
|||||||
member,
|
member,
|
||||||
this,
|
this,
|
||||||
{ id: member.user.id, name: member.user.username },
|
{ id: member.user.id, name: member.user.username },
|
||||||
{ server: member.guild.id, id: '', name: ''});
|
{ server: member.guild.id, id: '*', name: '*'});
|
||||||
this.plugin.stream.emitTo('channel', 'event', newMessage);
|
this.plugin.stream.emitTo('channel', 'event', newMessage);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "discord",
|
"name": "discord",
|
||||||
"version": "1.0.0"
|
"version": "1.1.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"typescript": true
|
"typescript": true
|
||||||
|
Loading…
Reference in New Issue
Block a user