Skip to content

Commit

Permalink
Release v1.0.0-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
NXVZBGBFBEN committed Dec 11, 2022
1 parent d7caba6 commit 96383e6
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,36 @@ client.on("messageUpdate", (oldMessage, newMessage) => {
if (oldMessage.author.id === client.user.id && newMessage.embeds[0] === undefined) {
oldMessage.edit({embeds: [oldMessage.embeds[0]]});
}
//TODO メッセージ編集検知機能追加
else {
if (oldMessage.author.avatarURL()) {
embed.setAuthor({name: `${oldMessage.author.username}`, iconURL: `${oldMessage.author.avatarURL()}`});
} else if (oldMessage.author.avatarURL() === null) {
embed.setAuthor({
name: `${oldMessage.author.username}`, iconURL: "https://cdn.discordapp.com/embed/avatars/1.png"
});
} else {
console.log("アバターアイコンで例外が発生しました");
}
}
});

client.on("messageDelete", message => {
if (message.author.avatarURL()) {
embed.setAuthor({name: `${message.author.username}`, iconURL: `${message.author.avatarURL()}`});
} else if (message.author.avatarURL() === null) {
embed.setAuthor({name: `${message.author.username}`, iconURL: "https://cdn.discordapp.com/embed/avatars/1.png"})
embed.setAuthor({
name: `${message.author.username}`, iconURL: "https://cdn.discordapp.com/embed/avatars/1.png"
});
} else {
console.log("アバターアイコンで例外が発生しました");
}
if (message.author.id === client.user.id) {
const r_embed = message.embeds[0];
message.channel.send({content: "**メッセージが削除されました**", embeds: [r_embed]});
message.channel.send({content: "**メッセージが削除されました**", embeds: [message.embeds[0]]});
} else if (message.author.bot) {
return;
}
//TODO 添付ファイルの処理
if (message.content) {
embed.setDescription(`${message.content}`);
if (message.attachments.size) {
Expand All @@ -42,4 +57,9 @@ client.on("messageDelete", message => {
message.channel.send({content: "**メッセージが削除されました**", embeds: [embed]});
});


//TODO スラッシュコマンド類
//TODO スクリーンショット機能
//TODO コンフィグ類

client.login(process.env.TOKEN);

0 comments on commit 96383e6

Please sign in to comment.