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