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

28 lines
621 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}`);
2018-07-01 03:35:51 +03:00
msg.channel.createMessage("```" + roles.join("\n") + "```");
}
}