Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
pollを多言語対応化させた
Browse files Browse the repository at this point in the history
  • Loading branch information
ringo360 committed Feb 24, 2024
1 parent f961250 commit 01d5361
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
27 changes: 13 additions & 14 deletions commands/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ const { LANG } = require('../util/languages');

module.exports = {
data: new SlashCommandBuilder()
//TODO: i18n support
.setName('poll')
.setDescription('soon')
.addStringOption(option=>option.setName('title').setDescription('Pollのタイトル').setRequired(true))
.addStringOption(option=>option.setName('choice1').setDescription('選択肢を入力...').setRequired(true))
.addStringOption(option=>option.setName('choice2').setDescription('選択肢を入力...').setRequired(true))
.addStringOption(option=>option.setName('choice3').setDescription('選択肢を入力...'))
.addStringOption(option=>option.setName('choice4').setDescription('選択肢を入力...'))
.addStringOption(option=>option.setName('choice5').setDescription('選択肢を入力...'))
.addStringOption(option=>option.setName('choice6').setDescription('選択肢を入力...'))
.addStringOption(option=>option.setName('choice7').setDescription('選択肢を入力...'))
.addStringOption(option=>option.setName('choice8').setDescription('選択肢を入力...'))
.addStringOption(option=>option.setName('choice9').setDescription('選択肢を入力...'))
.addStringOption(option=>option.setName('choice10').setDescription('選択肢を入力...')),
.setName(LANG.commands.poll.name)
.setDescription(LANG.commands.poll.description)
.addStringOption(option=>option.setName('title').setDescription(LANG.commands.poll.polltitle).setRequired(true))
.addStringOption(option=>option.setName('choice1').setDescription(LANG.commands.poll.pollchoices).setRequired(true))
.addStringOption(option=>option.setName('choice2').setDescription(LANG.commands.poll.pollchoices).setRequired(true))
.addStringOption(option=>option.setName('choice3').setDescription(LANG.commands.poll.pollchoices))
.addStringOption(option=>option.setName('choice4').setDescription(LANG.commands.poll.pollchoices))
.addStringOption(option=>option.setName('choice5').setDescription(LANG.commands.poll.pollchoices))
.addStringOption(option=>option.setName('choice6').setDescription(LANG.commands.poll.pollchoices))
.addStringOption(option=>option.setName('choice7').setDescription(LANG.commands.poll.pollchoices))
.addStringOption(option=>option.setName('choice8').setDescription(LANG.commands.poll.pollchoices))
.addStringOption(option=>option.setName('choice9').setDescription(LANG.commands.poll.pollchoices))
.addStringOption(option=>option.setName('choice10').setDescription(LANG.commands.poll.pollchoices)),
execute: async function (interaction) {
await interaction.deferReply();
const { channel } = await interaction;
Expand Down
9 changes: 5 additions & 4 deletions language/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,11 @@
"volumeSave": "サーバーの規定値として音量を${0}に設定しました!",
"error": "うわーん!吐血しちゃったよぉ..."
},
"result": {
"title": "awa",
"url": "a",
"clickToCopy": "a"
"poll": {
"name": "poll",
"description": "pollを作成します。",
"polltitle": "Pollのタイトル",
"pollchoices": "選択肢を入力..."
}
}
}
6 changes: 6 additions & 0 deletions language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,12 @@
"volumeSet": "Set the volume to ${0}!",
"volumeSave": "Set the volume to ${0} as the default value of the server!",
"error": "An error occurred"
},
"poll": {
"name": "poll",
"description": "Create a new poll.",
"polltitle": "Type your title!",
"pollchoices": "Type your choices..."
}
}
}

0 comments on commit 01d5361

Please sign in to comment.