mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Add proper types to sendErrorMessage()
This commit is contained in:
parent
6896afebfa
commit
edaeb7ef0e
23 changed files with 123 additions and 78 deletions
|
@ -30,7 +30,8 @@ export const AddCaseCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
// If the user exists as a guild member, make sure we can act on them first
|
||||
|
|
|
@ -34,7 +34,8 @@ export const BanCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const memberToBan = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
|
|
@ -37,7 +37,8 @@ export const CasesUserCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const cases = await pluginData.state.cases.with("notes").getByUserId(user.id);
|
||||
|
|
|
@ -32,7 +32,8 @@ export const ForcebanCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
// If the user exists as a guild member, make sure we can act on them first
|
||||
|
|
|
@ -34,7 +34,8 @@ export const ForcemuteCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const memberToMute = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
|
|
@ -32,7 +32,8 @@ export const ForceUnmuteCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if they're muted in the first place
|
||||
|
|
|
@ -44,7 +44,8 @@ export const MuteCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const memberToMute = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
|
|
@ -21,7 +21,8 @@ export const NoteCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const userName = `${user.username}#${user.discriminator}`;
|
||||
|
|
|
@ -29,7 +29,8 @@ export const UnbanCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
// The moderator who did the action is the message author or, if used, the specified -mod
|
||||
|
|
|
@ -34,7 +34,8 @@ export const UnmuteCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const memberToUnmute = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
|
|
@ -30,7 +30,8 @@ export const WarnCmd = modActionsCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const user = await resolveUser(pluginData.client, args.user);
|
||||
if (!user.id) {
|
||||
return sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
sendErrorMessage(pluginData, msg.channel, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const memberToWarn = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue