mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-11-02 15:29:50 +01:00
feat(arabot): add DMs when given role
This commit is contained in:
parent
5879c1a610
commit
be0b57890d
@ -51,10 +51,11 @@ class BookClubCommand extends Command {
|
||||
// TODO add database updates
|
||||
// Get the arguments
|
||||
const user = interaction.options.getUser('user');
|
||||
const mod = interaction.member;
|
||||
const { guild } = interaction;
|
||||
|
||||
// Checks if all the variables are of the right type
|
||||
if (user === null || guild === null) {
|
||||
if (user === null || mod === null || guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
@ -93,6 +94,9 @@ class BookClubCommand extends Command {
|
||||
content: `Gave ${user} the ${bookClub.name} role!`,
|
||||
fetchReply: true,
|
||||
});
|
||||
|
||||
await user.send(`You have been given the ${bookClub.name} role by ${mod}!`)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
public async messageRun(message: Message, args: Args) {
|
||||
|
||||
@ -51,10 +51,11 @@ class DebateHostCommand extends Command {
|
||||
// TODO add database updates
|
||||
// Get the arguments
|
||||
const user = interaction.options.getUser('user');
|
||||
const mod = interaction.member;
|
||||
const { guild } = interaction;
|
||||
|
||||
// Checks if all the variables are of the right type
|
||||
if (user === null || guild === null) {
|
||||
if (user === null || mod === null || guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
@ -93,6 +94,9 @@ class DebateHostCommand extends Command {
|
||||
content: `Gave ${user} the ${debate.name} role!`,
|
||||
fetchReply: true,
|
||||
});
|
||||
|
||||
await user.send(`You have been given the ${debate.name} role by ${mod}!`)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
public async messageRun(message: Message, args: Args) {
|
||||
|
||||
@ -51,10 +51,11 @@ class GameNightHostCommand extends Command {
|
||||
// TODO add database updates
|
||||
// Get the arguments
|
||||
const user = interaction.options.getUser('user');
|
||||
const mod = interaction.member;
|
||||
const { guild } = interaction;
|
||||
|
||||
// Checks if all the variables are of the right type
|
||||
if (user === null || guild === null) {
|
||||
if (user === null || mod === null || guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
@ -93,6 +94,9 @@ class GameNightHostCommand extends Command {
|
||||
content: `Gave ${user} the ${game.name} role!`,
|
||||
fetchReply: true,
|
||||
});
|
||||
|
||||
await user.send(`You have been given the ${game.name} role by ${mod}!`)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
public async messageRun(message: Message, args: Args) {
|
||||
|
||||
@ -51,10 +51,11 @@ class StageHostCommand extends Command {
|
||||
// TODO add database updates
|
||||
// Get the arguments
|
||||
const user = interaction.options.getUser('user');
|
||||
const mod = interaction.member;
|
||||
const { guild } = interaction;
|
||||
|
||||
// Checks if all the variables are of the right type
|
||||
if (user === null || guild === null) {
|
||||
if (user === null || mod === null || guild === null) {
|
||||
await interaction.reply({
|
||||
content: 'Error fetching user!',
|
||||
ephemeral: true,
|
||||
@ -93,6 +94,9 @@ class StageHostCommand extends Command {
|
||||
content: `Gave ${user} the ${stageHost.name} role!`,
|
||||
fetchReply: true,
|
||||
});
|
||||
|
||||
await user.send(`You have been given the ${stageHost.name} role by ${mod}!`)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
public async messageRun(message: Message, args: Args) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user