-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from CHProducts/dev
機能追加とバグ修正と
- Loading branch information
Showing
16 changed files
with
99 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { embeds } from '../embeds'; | ||
import axios from 'axios'; | ||
import { Message, EmbedBuilder } from 'discord.js'; | ||
|
||
export async function mcbeskinCommand(message: Message) { | ||
const name = message.content.split(' ')[1]; | ||
if (!name) return message.reply(embeds.mcbeskinHelp); | ||
try { | ||
const response = await axios.get(`https://api.geysermc.org/v2/xbox/xuid/${name}`); | ||
const xuid = response.data.xuid.toString(16).toUpperCase(); | ||
const uuid = '00000000-0000-0000-000' + xuid.slice(0, 1) + '-' + xuid.slice(1); | ||
const embed = new EmbedBuilder() | ||
.setTitle(`${name}のスキン`) | ||
.setColor('#0099ff') | ||
.setImage(`https://api.tydiumcraft.net/v1/players/skin?uuid=${uuid}&type=player`) | ||
.setThumbnail(`https://api.tydiumcraft.net/v1/players/skin?uuid=${uuid}&type=skin`); | ||
message.reply({ embeds: [embed] }); | ||
} catch (error) { | ||
message.reply(embeds.defaultError); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { embeds } from '../embeds'; | ||
import axios from 'axios'; | ||
import { ChatInputCommandInteraction, EmbedBuilder } from 'discord.js'; | ||
|
||
export async function mcbeskinCommand(interaction: ChatInputCommandInteraction) { | ||
await interaction.deferReply(); | ||
const name = interaction.options.getString('user'); | ||
try { | ||
const response = await axios.get(`https://api.geysermc.org/v2/xbox/xuid/${name}`); | ||
const xuid = response.data.xuid.toString(16).toUpperCase(); | ||
const uuid = '00000000-0000-0000-000' + xuid.slice(0, 1) + '-' + xuid.slice(1); | ||
const embed = new EmbedBuilder() | ||
.setTitle(`${name}のスキン`) | ||
.setColor('#0099ff') | ||
.setImage(`https://api.tydiumcraft.net/v1/players/skin?uuid=${uuid}&type=player`) | ||
.setThumbnail(`https://api.tydiumcraft.net/v1/players/skin?uuid=${uuid}&type=skin`); | ||
interaction.followUp({ embeds: [embed] }); | ||
} catch (error) { | ||
interaction.followUp(embeds.defaultError); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { EmbedBuilder, ChatInputCommandInteraction, ButtonBuilder, ButtonStyle, ActionRowBuilder } from 'discord.js'; | ||
|
||
export async function ticketCommand(interaction: ChatInputCommandInteraction) { | ||
const title = interaction.options.getString('title') ?? 'お問い合わせ'; | ||
const description = interaction.options.getString('description') ?? 'ボタンを押してチケットを作成してください。'; | ||
const embed = new EmbedBuilder().setTitle(title).setDescription(description).setColor('#0099ff').setFooter({ text: 'Motcher v2.0' }); | ||
|
||
const button = new ButtonBuilder().setCustomId('createticket').setLabel('Create Ticket🎫').setStyle(ButtonStyle.Primary); | ||
|
||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(button); | ||
await interaction.channel?.send({ embeds: [embed], components: [row] }); | ||
await interaction.reply({ content: 'チケットを作成しました。', ephemeral: true }); | ||
} |