質問編集履歴
2
余計なコードを削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -135,10 +135,6 @@
|
|
135
135
|
res.end();
|
136
136
|
}).listen(8080);
|
137
137
|
|
138
|
-
|
139
|
-
const VERSION = "?"
|
140
|
-
var daybase = ["日", "月", "火", "水", "木", "金", "土"];
|
141
|
-
|
142
138
|
for (const file of commandFiles) {
|
143
139
|
const filePath = path.join(commandsPath, file);
|
144
140
|
const command = require(filePath);
|
@@ -172,69 +168,6 @@
|
|
172
168
|
});
|
173
169
|
|
174
170
|
//ここから別のやつ〜//
|
175
|
-
|
176
|
-
const commands = [
|
177
|
-
{
|
178
|
-
name: "ping",
|
179
|
-
description: "ぽん!",
|
180
|
-
},
|
181
|
-
];
|
182
|
-
|
183
|
-
|
184
|
-
(async () => {
|
185
|
-
try {
|
186
|
-
console.log("アプリケーションコマンドを読み込んでいます");
|
187
|
-
|
188
|
-
await rest.put(Routes.applicationCommands(CLIENT_ID), { body: commands });
|
189
|
-
|
190
|
-
console.log("読み込みました");
|
191
|
-
} catch (error) {
|
192
|
-
console.error(error);
|
193
|
-
}
|
194
|
-
})();
|
195
|
-
|
196
|
-
|
197
|
-
client.on("interactionCreate", async (interaction) => {
|
198
|
-
if (!interaction.isChatInputCommand()) return;
|
199
|
-
|
200
|
-
if (interaction.commandName === "ping") {
|
201
|
-
await interaction.reply("ぽん!");
|
202
|
-
}
|
203
|
-
});
|
204
|
-
|
205
|
-
//ここから別のやつ〜//
|
206
|
-
|
207
|
-
client.once("ready", () => {
|
208
|
-
const START = new EmbedBuilder()
|
209
|
-
.setTitle("スタート")
|
210
|
-
.setColor(0x6040f3)
|
211
|
-
client.channels.cache.get(CHANNEL_ID).send({ embeds: [START] })
|
212
|
-
|
213
|
-
console.log("スタ〜ト〜")
|
214
|
-
client.user.setActivity("DiscordでBOT開発")
|
215
|
-
});//曜日系
|
216
|
-
|
217
|
-
//ここから別のやつ〜//
|
218
|
-
|
219
|
-
client.on("messageCreate", async message => {
|
220
|
-
if(message.content == "BETA"){
|
221
|
-
message.channel.send("TEST")
|
222
|
-
};
|
223
|
-
if(message.content == "こんにちは〜"||message.content == "今日"){
|
224
|
-
var base = new Date();
|
225
|
-
var month = base.getMonth();
|
226
|
-
var date = base.getDate();
|
227
|
-
var dayget = base.getDay();
|
228
|
-
var day = daybase[dayget];
|
229
|
-
var hours = base.getHours();
|
230
|
-
var minutes = base.getMinutes();
|
231
|
-
var lastoutput = "今日は" + (month + 1) + "月" + date + "日、"
|
232
|
-
+ day + "曜日" + "です。";
|
233
|
-
message.channel.send("lastoutput)
|
234
|
-
};
|
235
|
-
});
|
236
|
-
|
237
|
-
|
238
171
|
//Discordにログイン〜
|
239
172
|
client.login(TOKEN);
|
240
173
|
|
1
タイトルを良い例に寄せました
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Discord.js
|
1
|
+
Discord.jsでスラッシュコマンドを登録しようとするとDiscordAPIError[50035]というエラーが出る
|
test
CHANGED
File without changes
|