Change: kubectl and service image
This commit is contained in:
@@ -5,7 +5,7 @@ import discord, {
|
||||
SlashCommandRoleOption,
|
||||
SlashCommandStringOption,
|
||||
InteractionResponse,
|
||||
Role, APIRole
|
||||
Role, APIRole
|
||||
} from 'discord.js';
|
||||
|
||||
import {Command} from '../../classes/command';
|
||||
@@ -14,7 +14,7 @@ import {logger} from '../../logger';
|
||||
type CIOR = CommandInteractionOptionResolver;
|
||||
|
||||
function isRole(role: Role | APIRole): role is Role {
|
||||
return role['id'] !== null;
|
||||
return role['id'] !== null;
|
||||
}
|
||||
|
||||
class ApplyRole extends Command{
|
||||
@@ -29,31 +29,31 @@ class ApplyRole extends Command{
|
||||
if(!interaction.guild || !interaction.guild.id || !interaction.guild.name)
|
||||
throw Error('guild not exist');
|
||||
|
||||
await interaction.reply('Start applying.');
|
||||
let counter: number = 0;
|
||||
await interaction.reply('Start applying.');
|
||||
let counter: number = 0;
|
||||
|
||||
const memberList = await interaction.guild.members.fetch();
|
||||
logger.debug('fetch done');
|
||||
const memberList = await interaction.guild.members.fetch();
|
||||
logger.debug('fetch done');
|
||||
|
||||
await memberList.each(async member => {
|
||||
if (!role)
|
||||
throw Error('role not exist');
|
||||
if (!interaction.guild)
|
||||
throw Error('guild not exist');
|
||||
console.log(`${role.id}, ${member}`);
|
||||
await memberList.each(async member => {
|
||||
if (!role)
|
||||
throw Error('role not exist');
|
||||
if (!interaction.guild)
|
||||
throw Error('guild not exist');
|
||||
console.log(`${role.id}, ${member}`);
|
||||
|
||||
await interaction.guild.members.addRole({
|
||||
role: role.id,
|
||||
user: member,
|
||||
});
|
||||
logger.log(`role ${role} has been added to ${member}.`);
|
||||
counter += 1;
|
||||
if (counter % 10 === 0)
|
||||
await interaction.editReply(`${counter} applied.`);
|
||||
});
|
||||
await interaction.editReply(`All ${counter} applied.`);
|
||||
logger.log(`All ${counter} applied.`);
|
||||
|
||||
await interaction.guild.members.addRole({
|
||||
role: role.id,
|
||||
user: member,
|
||||
});
|
||||
logger.log(`role ${role} has been added to ${member}.`);
|
||||
counter += 1;
|
||||
if (counter % 10 === 0)
|
||||
await interaction.editReply(`${counter} applied.`);
|
||||
});
|
||||
await interaction.editReply(`All ${counter} applied.`);
|
||||
logger.log(`All ${counter} applied.`);
|
||||
|
||||
}catch(err: unknown){
|
||||
let message;
|
||||
if(err instanceof Error) message = err.message;
|
||||
|
||||
Reference in New Issue
Block a user