3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 22:21:51 +00:00
zeppelin/src/plugins/Utility.ts

30 lines
633 B
TypeScript
Raw Normal View History

2018-07-01 03:35:51 +03:00
import { Plugin, decorators as d } from "knub";
import { Message, TextChannel } from "eris";
export class UtilityPlugin extends Plugin {
getDefaultOptions() {
return {
permissions: {
roles: false
},
overrides: [
{
level: ">=50",
permissions: {
roles: true
}
}
]
};
}
@d.command("roles")
@d.permission("roles")
async rolesCmd(msg: Message) {
const roles = (msg.channel as TextChannel).guild.roles.map(
role => `${role.name} ${role.id}`
);
msg.channel.createMessage("```" + roles.join("\n") + "```");
}
}