Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/hychat-mc/self-host
Browse files Browse the repository at this point in the history
  • Loading branch information
xMdb committed Apr 1, 2022
2 parents 206048f + fe10829 commit 9a5d7cf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/commands/ChangeRank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export default {
const type: string = args[0] as 'promote' | 'demote';
const user: string = args[1];

let embed: MessageEmbed;
const embed = new MessageEmbed();
try {
await bot.executeTask(`/g ${type} ${user}`);
embed = new MessageEmbed()
embed
.setTitle(await CapitaliseString(`${type}d!`))
.setDescription(`${user} has been ${type}d!`)
.setColor(type === 'promote' ? 'GREEN' : 'RED');
} catch (e) {
embed = new MessageEmbed()
embed
.setColor('RED')
.setTitle('Error')
.setDescription(e as string);
Expand Down
9 changes: 3 additions & 6 deletions src/commands/Invite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ export default {
run: async (bot, interaction, args) => {
const user = args[0];

let embed: MessageEmbed;
const embed = new MessageEmbed();
try {
await bot.executeTask(`/g invite ${user}`);
embed = new MessageEmbed()
.setTitle('Invited!')
.setDescription(`\`${user}\` has been invited to the guild!`)
.setColor('GREEN');
embed.setTitle('Invited!').setDescription(`\`${user}\` has been invited to the guild!`).setColor('GREEN');
} catch (e) {
embed = new MessageEmbed()
embed
.setColor('RED')
.setTitle('Error')
.setDescription(e as string);
Expand Down
11 changes: 4 additions & 7 deletions src/commands/Kick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@ export default {
const user: string = args[0];
const reason: string = args[1];

let embed: MessageEmbed;
const embed = new MessageEmbed();
try {
await bot.executeTask(`/g kick ${user} ${reason}`);
embed = new MessageEmbed()
.setTitle('Kicked!')
.setDescription(`\`${user}\` has been kicked for \`${reason}\``)
.setColor('RED');
embed.setTitle('Kicked!').setDescription(`\`${user}\` has been kicked for \`${reason}\``).setColor('RED');
} catch (e) {
embed = new MessageEmbed()
embed
.setColor('RED')
.setTitle('Error')
.setDescription(e as string);
}

await interaction.reply({ embeds: [embed] });
},
} as Command;
7 changes: 3 additions & 4 deletions src/commands/ToggleMute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@ export default {
const user: string = args[0];
const duration: string = args[1];

let embed: MessageEmbed;
const embed = new MessageEmbed();
try {
await bot.executeTask(`/g ${type} ${user} ${duration}`);
embed = new MessageEmbed()
embed
.setTitle(await CapitaliseString(`${type}d!`))
.setDescription(`${user} was ${type}d` + (type === 'mute' ? ` for ${duration}!` : '!'))
.setColor(type === 'mute' ? 'RED' : 'GREEN');
} catch (e) {
embed = new MessageEmbed()

embed
.setColor('RED')
.setTitle('Error')
.setDescription(e as string);
Expand Down

0 comments on commit 9a5d7cf

Please sign in to comment.