Skip to content

Commit

Permalink
🧹 format code
Browse files Browse the repository at this point in the history
  • Loading branch information
MotiCAT committed Mar 2, 2024
1 parent 08f1efd commit b287c64
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
16 changes: 13 additions & 3 deletions src/embeds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const embeds = {
{ name: 'Commands', value: '`server`, `user`, `list`, `invite`, `search`' },
{
name: 'Server',
value: '`join`, `leave`, `response`, `log`'
value: '`join`, `leave`, `response`, `log`, `ticket`'
},
{ name: 'Minecraft', value: '`mcskin`, `mcstatus`' },
{ name: 'Minecraft', value: '`mcskin`, `mcbeskin`, `mcstatus`' },
{ name: 'Moderation', value: '`ban`, `unban`, `kick`, `role`, `clear`, `timeout`, `untimeout`' }
)
.setTimestamp()
Expand All @@ -40,7 +40,7 @@ export const embeds = {
},
{
name: ':arrow_up:botの歴史',
value: '```diff\n+ 2023/05/21 認証\n+ 2023/02/21 v1.0 Release\n- 2023/02/10 暴走\n+ 2022/05/15 Botアカウントの作成\n```'
value: '```diff\n+ 2023/06/27 100サーバー達成\n+ 2023/05/21 認証\n+ 2023/02/21 v1.0 Release\n- 2023/02/10 暴走\n+ 2022/05/15 Botアカウントの作成\n```'
},
{
name: ':link:関連リンク',
Expand Down Expand Up @@ -150,6 +150,16 @@ export const embeds = {
.setColor('#ff0000')
.build(),
kickSuccess: new Builder().addFields({ name: 'Success', value: '指定したユーザーをkickしました。' }).setColor('#0099ff').build(),
mcbeskinHelp: new Builder()
.setTitle('mcbeskinコマンド')
.setDescription('指定したユーザーのマイクラBEスキンを取得するコマンド')
.setColor('#0099ff')
.addFields({
name: '使い方',
value: 'mc!mcbeskin ユーザー名'
})
.setFooter({ text: 'Motcher v2.0' })
.build(),
mcskinHelp: new Builder()
.setTitle('mcskinコマンド')
.setDescription('指定したユーザーのマイクラスキンを取得するコマンド')
Expand Down
1 change: 0 additions & 1 deletion src/interactions/ban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export async function banCommand(interaction: ChatInputCommandInteraction) {
if (!(interaction.member instanceof GuildMember)) return;
if (!interaction.guild?.members.me?.permissions.has(PermissionsBitField.Flags.BanMembers)) return interaction.reply(embeds.banPermissionError);
const member = interaction.options.getMember('member') as GuildMember;
if (!member) return interaction.reply(embeds.banHelp);
member
.ban()
.then(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/interactions/mcskin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { embeds } from '../embeds';
import { ChatInputCommandInteraction, EmbedBuilder } from 'discord.js';

export async function mcskinCommand(interaction: ChatInputCommandInteraction) {
const name = interaction.options.getString('user');
if (!name) return interaction.reply(embeds.mcskinHelp);
const embed = new EmbedBuilder()
.setTitle(`${name}のスキン`)
.setColor('#0099ff')
Expand Down
1 change: 0 additions & 1 deletion src/interactions/mcstatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export async function mcstatusCommand(interaction: ChatInputCommandInteraction)
const mcServerIp = interaction.options.getString('address');
const mcServerPort = interaction.options.getInteger('port') ?? 25565;
const url = `https://mcapi.us/server/status?ip=${mcServerIp}&port=${mcServerPort}`;
if (!mcServerIp) return interaction.reply(embeds.mcstatusHelp);
axios
.get(url)
.then((response) => {
Expand Down
1 change: 0 additions & 1 deletion src/interactions/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export async function roleCommand(interaction: ChatInputCommandInteraction) {
return interaction.reply(embeds.roleAddPermissionError);
const role = interaction.options.getRole('role') as Role;
const member = interaction.options.getMember('member') as GuildMember;
if (!role || !member) return interaction.reply(embeds.roleAddHelp);
member.roles
.add(role)
.then(() => {
Expand Down

0 comments on commit b287c64

Please sign in to comment.