mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 21:35:02 +00:00
Migrate PingableRoles to new Plugin structure
This commit is contained in:
parent
f324dfc227
commit
ed344be4b5
9 changed files with 232 additions and 0 deletions
backend/src/plugins/PingableRoles/utils
|
@ -0,0 +1,17 @@
|
|||
import { PingableRole } from "src/data/entities/PingableRole";
|
||||
import { PluginData } from "knub";
|
||||
import { PingableRolesPluginType } from "../types";
|
||||
|
||||
export function disablePingableRoles(pluginData: PluginData<PingableRolesPluginType>, pingableRoles: PingableRole[]) {
|
||||
for (const pingableRole of pingableRoles) {
|
||||
const role = pluginData.guild.roles.get(pingableRole.role_id);
|
||||
if (!role) continue;
|
||||
|
||||
role.edit(
|
||||
{
|
||||
mentionable: false,
|
||||
},
|
||||
"Disable pingable role",
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue