mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-18 07:35:02 +00:00
Add auto-reaction support
This commit is contained in:
parent
df08e12334
commit
9670a17e99
7 changed files with 233 additions and 10 deletions
|
@ -1,16 +1,12 @@
|
|||
import { Plugin, decorators as d } from "knub";
|
||||
import { errorMessage, isSnowflake } from "../utils";
|
||||
import { CustomEmoji, errorMessage, isSnowflake } from "../utils";
|
||||
import { GuildReactionRoles } from "../data/GuildReactionRoles";
|
||||
import { Channel, Emoji, Message, TextChannel } from "eris";
|
||||
import { Channel, Message, TextChannel } from "eris";
|
||||
|
||||
type ReactionRolePair = [string, string];
|
||||
|
||||
type CustomEmoji = {
|
||||
id: string;
|
||||
} & Emoji;
|
||||
|
||||
export class ReactionRolesPlugin extends Plugin {
|
||||
public static pluginName = 'reaction_roles';
|
||||
public static pluginName = "reaction_roles";
|
||||
|
||||
protected reactionRoles: GuildReactionRoles;
|
||||
|
||||
|
@ -81,7 +77,7 @@ export class ReactionRolesPlugin extends Plugin {
|
|||
const newRolePairs: ReactionRolePair[] = args.reactionRolePairs
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map(v => v.split("=").map(v => v.trim()))
|
||||
.map(v => v.split("=").map(v => v.trim())) // tslint:disable-line
|
||||
.map(
|
||||
(pair): ReactionRolePair => {
|
||||
const customEmojiMatch = pair[0].match(/^<:(?:.*?):(\d+)>$/);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue