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

Commit

Permalink
Merge pull request #314 from OutiServer/develop
Browse files Browse the repository at this point in the history
Release 3.2.2
  • Loading branch information
KenCir authored Sep 24, 2022
2 parents 567050e + 602f6a6 commit 17037cb
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/commands/minecraft/outiserverstatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {
.setTitle('おうちサーバーの状態')
.addFields([
{ name: 'プレイヤー数', value: `${status.players.online}/${status.players.max}` },
{ name: 'IP', value: '126.75.152.179' },
{ name: 'IP', value: '126.21.60.218' },
{ name: 'Port', value: '50000' },
{ name: 'Version', value: status.version.name },
])
Expand Down
101 changes: 44 additions & 57 deletions src/events/discord/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,91 +75,78 @@ module.exports = async (client, interaction) => {
await interaction.followUp('お知らせを付与しました');
}
break;
default:
break;
}
}
else if (interaction.isSelectMenu() && interaction.customId === 'role_panel') {
const result = [];
await interaction.deferReply({ ephemeral: true });
if (interaction.values.length < 1) return await interaction.followUp('付与も剥奪も行いませんでした');
for (const role of interaction.values) {
if (role === 'among_us') {
if (interaction.member.roles.cache.has('774593459034128395')) {
await interaction.member.roles.remove('774593459034128395');
result.push('AmongUs Crewを剥奪しました');
case 'announce':
await interaction.deferReply({ ephemeral: true });
if (interaction.member.roles.cache.has('826994784614219846')) {
await interaction.member.roles.remove('826994784614219846');
await interaction.followUp('お知らせを剥奪しました');
}
else {
await interaction.member.roles.add('774593459034128395');
result.push('AmongUs Crewを付与しました');
await interaction.member.roles.add('826994784614219846');
await interaction.followUp('お知らせを付与しました');
}
}
else if (role === 'temp_announce') {
break;
case 'temp_announce':
await interaction.deferReply({ ephemeral: true });
if (interaction.member.roles.cache.has('780217228649562113')) {
await interaction.member.roles.remove('780217228649562113');
result.push('臨時お知らせを剥奪しました');
await interaction.followUp('臨時お知らせを剥奪しました');
}
else {
await interaction.member.roles.add('780217228649562113');
result.push('臨時お知らせを付与しました\n10分後自動で剥奪します');
await interaction.followUp('臨時お知らせを付与しました\n10分後自動で剥奪します');
setTimeout(async () => {
await interaction.member.roles.remove('780217228649562113');
}, 600000);
}
}
else if (role === 'mention_announce') {
if (interaction.member.roles.cache.has('826994784614219846')) {
await interaction.member.roles.remove('826994784614219846');
result.push('お知らせを剥奪しました');
break;
case 'among_us':
await interaction.deferReply({ ephemeral: true });
if (interaction.member.roles.cache.has('774593459034128395')) {
await interaction.member.roles.remove('774593459034128395');
await interaction.followUp('AmongUs Crewを剥奪しました');
}
else {
await interaction.member.roles.add('826994784614219846');
result.push('お知らせを付与しました');
await interaction.member.roles.add('774593459034128395');
await interaction.followUp('AmongUs Crewを付与しました');
}
}
else if (role === 'illustrator') {
if (interaction.member.roles.cache.has('875684910071955508')) {
await interaction.member.roles.remove('875684910071955508');
result.push('お絵描きを剥奪しました');
break;
case 'study_member':
await interaction.deferReply({ ephemeral: true });
if (interaction.member.roles.cache.has('972467400941379625')) {
await interaction.member.roles.remove('972467400941379625');
await interaction.followUp('学ぶ者を剥奪しました');
}
else {
await interaction.member.roles.add('875684910071955508');
result.push('お絵描きを付与しました');
await interaction.member.roles.add('972467400941379625');
await interaction.followUp('学ぶ者を付与しました');
}
}
else if (role === 'work_call') {
break;
case 'work_call':
await interaction.deferReply({ ephemeral: true });
if (interaction.member.roles.cache.has('969526525647020052')) {
await interaction.member.roles.remove('969526525647020052');
result.push('作業通話を剥奪しました');
await interaction.followUp('作業通話を剥奪しました');
}
else {
await interaction.member.roles.add('969526525647020052');
result.push('作業通話を付与しました');
await interaction.followUp('作業通話を付与しました');
}
}
else if (role === 'study_member') {
if (interaction.member.roles.cache.has('972467400941379625')) {
await interaction.member.roles.remove('972467400941379625');
result.push('学ぶ者を剥奪しました');
}
else {
await interaction.member.roles.add('972467400941379625');
result.push('学ぶ者を付与しました');
}
}
else if (role === 'ghost_investigator') {
if (interaction.member.roles.cache.has('977401797935251486')) {
await interaction.member.roles.remove('977401797935251486');
result.push('幽霊調査員を剥奪しました');
break;
case 'ghost_investigator':
await interaction.deferReply({ ephemeral: true });
if (interaction.member.roles.cache.has('1021294713501921290')) {
await interaction.member.roles.remove('1021294713501921290');
await interaction.followUp('幽霊調査員を剥奪しました');
}
else {
await interaction.member.roles.add('977401797935251486');
result.push('幽霊調査員を付与しました');
await interaction.member.roles.add('1021294713501921290');
await interaction.followUp('幽霊調査員を付与しました');
}
}
break;
default:
break;
}

await interaction.followUp(result.join('\n'));
}
else if (interaction.type === InteractionType.ModalSubmit) {
if (interaction.customId === 'report') {
Expand Down
45 changes: 45 additions & 0 deletions src/events/discord/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,51 @@ module.exports = async (client) => {
client.user.setActivity({ name: '/help おうち鯖', type: ActivityType.Playing });
client.logger.info(`Logged in as ${client.user.tag}`);

// 通常鯖の
/*
const msg = await client.channels.cache.get('774594290679545886').messages.fetch('1008311079383863336');
msg.edit({
embeds: [
new EmbedBuilder()
.setTitle('ロール付与・剥奪')
.setDescription('ロールがついている状態でボタンを押すと剥奪\nロールがついてない状態でボタンを押すと付与されます\n臨時お知らせは付与から10分経つと自動的に剥奪されます'),
],
components: [
new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('announce')
.setStyle(ButtonStyle.Primary)
.setLabel('お知らせ'),
new ButtonBuilder()
.setCustomId('temp_announce')
.setStyle(ButtonStyle.Primary)
.setLabel('臨時お知らせ'),
new ButtonBuilder()
.setCustomId('among_us')
.setStyle(ButtonStyle.Primary)
.setLabel('AmongUs Crew'),
new ButtonBuilder()
.setCustomId('study_member')
.setStyle(ButtonStyle.Primary)
.setLabel('学ぶもの'),
new ButtonBuilder()
.setCustomId('work_call')
.setStyle(ButtonStyle.Primary)
.setLabel('作業通話'),
),
new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('ghost_investigator')
.setStyle(ButtonStyle.Primary)
.setLabel('幽霊調査員'),
),
],
});
*/

// 新サーバーのロールパネル
/*
client.channels.cache.get('1014141666321518652').send({
embeds: [
Expand Down

0 comments on commit 17037cb

Please sign in to comment.