mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 16:15:04 +00:00
Added Discord attachment link reaction, fixed emoji configuration and moved util functions
This commit is contained in:
parent
a4c4b17a14
commit
592d037148
173 changed files with 1540 additions and 1170 deletions
|
@ -1,5 +1,5 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CommonPlugin } from "../../Common/CommonPlugin";
|
||||
import { pingableRolesCmd } from "../types";
|
||||
|
||||
export const PingableRoleDisableCmd = pingableRolesCmd({
|
||||
|
@ -14,17 +14,17 @@ export const PingableRoleDisableCmd = pingableRolesCmd({
|
|||
async run({ message: msg, args, pluginData }) {
|
||||
const pingableRole = await pluginData.state.pingableRoles.getByChannelAndRoleId(args.channelId, args.role.id);
|
||||
if (!pingableRole) {
|
||||
sendErrorMessage(pluginData, msg.channel, `**${args.role.name}** is not set as pingable in <#${args.channelId}>`);
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendErrorMessage(msg, `**${args.role.name}** is not set as pingable in <#${args.channelId}>`);
|
||||
return;
|
||||
}
|
||||
|
||||
await pluginData.state.pingableRoles.delete(args.channelId, args.role.id);
|
||||
pluginData.state.cache.delete(args.channelId);
|
||||
|
||||
sendSuccessMessage(
|
||||
pluginData,
|
||||
msg.channel,
|
||||
`**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`,
|
||||
);
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendSuccessMessage(msg, `**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CommonPlugin } from "../../Common/CommonPlugin";
|
||||
import { pingableRolesCmd } from "../types";
|
||||
|
||||
export const PingableRoleEnableCmd = pingableRolesCmd({
|
||||
|
@ -17,21 +17,17 @@ export const PingableRoleEnableCmd = pingableRolesCmd({
|
|||
args.role.id,
|
||||
);
|
||||
if (existingPingableRole) {
|
||||
sendErrorMessage(
|
||||
pluginData,
|
||||
msg.channel,
|
||||
`**${args.role.name}** is already set as pingable in <#${args.channelId}>`,
|
||||
);
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendErrorMessage(msg, `**${args.role.name}** is already set as pingable in <#${args.channelId}>`);
|
||||
return;
|
||||
}
|
||||
|
||||
await pluginData.state.pingableRoles.add(args.channelId, args.role.id);
|
||||
pluginData.state.cache.delete(args.channelId);
|
||||
|
||||
sendSuccessMessage(
|
||||
pluginData,
|
||||
msg.channel,
|
||||
`**${args.role.name}** has been set as pingable in <#${args.channelId}>`,
|
||||
);
|
||||
pluginData
|
||||
.getPlugin(CommonPlugin)
|
||||
.sendSuccessMessage(msg, `**${args.role.name}** has been set as pingable in <#${args.channelId}>`);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue