Skip to content

Commit

Permalink
🔨 change env
Browse files Browse the repository at this point in the history
  • Loading branch information
yuito-it committed Aug 27, 2024
1 parent 34f56dd commit 69f4f94
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 77 deletions.
12 changes: 6 additions & 6 deletions argoCD/bot-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: unibot-env
name: bot-env
namespace: unibot
spec:
encryptedData:
DISCORD_TOKEN: AgB694B5STTG+zQbk2efF2jzUzEJMgbX1wdTsCnTfoAR0Y9V7SqLeLQ/Bn9GL/8uoGxixr5foT5yeKEMrHa29Xzp1bIxHAdkUKFc8hAbgFnim0wKOUs8SIDw+w9VBP9RAsBrvKlXt3Bt6MRuLx44aZ/OASZmIV4Nc3YBle2z6nOGs3hgYG1LGu/73N1aR7qNSqjWbOUwSqM2Ni7p/5+QvqXnpStoQPdIpxbIJEgWIzhKn1mZK1agxM3Kk5kfUsayJVuLWz0OnzNcPpyew7BwU6ld768dJAdJ/0cXgZdK+6Qr5QccsYdt3s2oQpX5q5QBZLqtnPrVpbTGF1fpJ4rSoFy7xmJnFmq4C9hx/ozcJAiuNxtBGdGoU+D/sd15an19/fzVaXDoRjCoou0sC5LHRVoWHWa23SGX0tt4wgk+Dc6q7ftZutAe+rzmcQprdtq8xrmLUPPEZUz0hNkotD+rCt7vZG8ojJROFwG8OUJVC4XGXgF++yGsDDng9dnT12asbOsXXSRS7/YX9ToI94e9LonRNjhQ10+kdNlI1DsJgHHrxkAvoON7k/CaRCVOJK1nF+5p44cXaZaHhe+hFzH16s6hXQZZhAp/ar1WWDe38qwYvOMOW1iJi8tLwxLOj4ck7iize+Ebhnzl0ngpiCwBfTvt6+rj8aAo+Is9BDrAiH6A/babl6UboseaaSlpYOXn3fIh5YBX+UxSlYTDSsMiRzeTIQ+8PlDgR28PwT/a/Q+JZKUO9HJXACNoxsh7v/Ho7QoUM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gXpLAWeA0/jyDNl2fnusUsLw2FoaVhq01F4DzceXe1gOrZIWLSXNHAZ/8SjQhaYRkzE5AGNT40lwmSpk9hx/EWr3w60aG7YPrblf9nJCS6XzvoYuwVoDOCBQZtLm89KP30SkTL0uj1PJljgoQRzOp0kNQNmlxxO/VB4ExRTbGjaIJjwKX+p/ZiyJrdTVfttwkcbGk03caTLFR7GlwX93dpOdt3/uQH7ghBtMeaQdjdGec7CkDEbo44u8wR1
LOG_SUCCESS_ID: AgB0D1ks8Py3qAiTe62WnMx9LWf+zD1Htjpd/BpWSro85YE89BJfI7E5YIQZgvPdu/DuomnGUM1oJuK/2e4Yszd3/NBUbUJz4AmzLnsZF8mrDQBpQ00ua4s2NhtoF5tY3MuSj+MJFT0w5Gf/tRsj5tx9B/kldKhSlvkY4sP/aBzspFPnYLnCGvj55D0kbICBubDYDjERyugNcFr9hOAN2ZOev9z86e8kC/931K9AGjdoN0ax1uAlwDqVy/vSrn4AZX6TzAQU+hnH8Pkv6cfmLICGiP/vhTMw7WDK8r2Uc3u0cYJoH+DSX+JXURGzF2wqsCKzgc+38VNh2WppwpONpfFWKg7c+VG/4OYeDsj8GH5r7IVmvH/i6/t3Pb3MT3h9t/7aAVypIN6thKkCkHUurvEAax455D8OQ+mTtTFlRQztK1NvAz4ow5G5Vj4heDQcDrZlqYU8NBlY+KZBwrVyiZybcZ1I6YNujQeXTs9fDvFSibqqNiu9sWhAW5XozHDavEANUwACJGaIsKJxLwJIn7VaqbdpI41MPybqDcpANohGneYkoKt6QzgdzY1O04O7iJnuf6VEgsnmohpJa0l/2cPTKO7+rvtnBUJIt8hvMiLwf2KeT/Fuj7wWuuO4xMy9xorXpmyB15hWCV0PzD1ayDv9D8RPl37nA8TZX7Zqm10gxTILCqJfNTJKUDATcRO6F20fZ4Jp4U+Og4D1mTYQ0hzqkCzy
template:
metadata:
creationTimestamp: null
name: unibot-env
name: bot-env
namespace: unibot
type: Opaque
1 change: 1 addition & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(require('dotenv')).config();
module.exports = {
adminRoleId: process.env.ROLE_ADMIN,
color: {
Expand Down
157 changes: 87 additions & 70 deletions events/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,96 @@ const config = require("../config");
const { GetLogChannel, GetErrorChannel } = require(`../lib/channelUtils`);

module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (interaction.isChatInputCommand()) {
console.log(`[!] ${interaction.commandName}`);
const command = interaction.client.commands.get(interaction.commandName);
if (!command) {
console.log(`[-] Not Found: ${interaction.commandName}`);
return;
}
if (!interaction.inGuild() && command.guildOnly) {
const embed = new EmbedBuilder()
.setTitle("エラー")
.setDescription("このコマンドはDMでは実行できません。")
.setColor(interaction.client.config.color.e);
interaction.reply({ embeds: [embed] });
return;
}
name: Events.InteractionCreate,
async execute(interaction) {
if (interaction.isChatInputCommand()) {
console.log(
`[${client.func.timeUtils.timeToJST(Date.now(), true)} - info]-> ${
interaction.commandName
}`
);
const command = interaction.client.commands.get(interaction.commandName);
if (!command) {
console.log(
`[${client.func.timeUtils.timeToJST(
Date.now(),
true
)} - info] Not Found: ${interaction.commandName}`
);
return;
}
if (!interaction.inGuild() && command.guildOnly) {
const embed = new EmbedBuilder()
.setTitle("エラー")
.setDescription("このコマンドはDMでは実行できません。")
.setColor(interaction.client.config.color.e);
interaction.reply({ embeds: [embed] });
return;
}

try {
await command.execute(interaction);
console.log(`[Run] ${interaction.commandName}`);
try {
await command.execute(interaction);
console.log(
`[${client.func.timeUtils.timeToJST(Date.now(), true)} - info] Run: ${
interaction.commandName
}`
);

const logEmbed = new EmbedBuilder()
.setTitle("コマンド実行ログ")
.setDescription(`${interaction.user} がコマンドを実行しました。`)
.setColor(config.color.s)
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.addFields([
{
name: "コマンド",
value: `\`\`\`\n/${interaction.commandName}\n\`\`\``,
},
{
name: "実行サーバー",
value: "```\n"
+ interaction.inGuild() ? `${interaction.guild.name} (${interaction.guild.id})` : "DM"
+ "\n```",
},
{
name: "実行ユーザー",
value: "```\n" + `${interaction.user.tag}(${interaction.user.id})` + "\n```",
},
])
.setFooter({ text: `${interaction.id}` });
const channel = await GetLogChannel(interaction);
if (channel) {
channel.send({ embeds: [logEmbed] });
}
} catch (error) {
console.error(error);
const logEmbed = new EmbedBuilder()
.setTitle("ERROR - cmd")
.setDescription("```\n" + error.toString() + "\n```")
.setColor(config.color.e)
.setTimestamp();
const logEmbed = new EmbedBuilder()
.setTitle("コマンド実行ログ")
.setDescription(`${interaction.user} がコマンドを実行しました。`)
.setColor(config.color.s)
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.addFields([
{
name: "コマンド",
value: `\`\`\`\n/${interaction.commandName}\n\`\`\``,
},
{
name: "実行サーバー",
value:
"```\n" + interaction.inGuild()
? `${interaction.guild.name} (${interaction.guild.id})`
: "DM" + "\n```",
},
{
name: "実行ユーザー",
value:
"```\n" +
`${interaction.user.tag}(${interaction.user.id})` +
"\n```",
},
])
.setFooter({ text: `${interaction.id}` });
const channel = await GetLogChannel(interaction);
if (channel) {
channel.send({ embeds: [logEmbed] });
}
} catch (error) {
console.error(error);
const logEmbed = new EmbedBuilder()
.setTitle("ERROR - cmd")
.setDescription("```\n" + error.toString() + "\n```")
.setColor(config.color.e)
.setTimestamp();

const channel = await GetErrorChannel(interaction);
if (channel) {
channel.send({ embeds: [logEmbed] });
}
const messageEmbed = new EmbedBuilder()
.setTitle("すみません、エラーが発生しました...")
.setDescription("```\n" + error + "\n```")
.setColor(config.color.e)
.setTimestamp();
const channel = await GetErrorChannel(interaction);
if (channel) {
channel.send({ embeds: [logEmbed] });
}
const messageEmbed = new EmbedBuilder()
.setTitle("すみません、エラーが発生しました...")
.setDescription("```\n" + error + "\n```")
.setColor(config.color.e)
.setTimestamp();

await interaction.reply(messageEmbed);
const logChannel = await GetLogChannel(interaction);
if (logChannel) {
logChannel.send({ embeds: [messageEmbed] });
}
}
await interaction.reply(messageEmbed);
const logChannel = await GetLogChannel(interaction);
if (logChannel) {
logChannel.send({ embeds: [messageEmbed] });
}
}
}
};
},
};
1 change: 0 additions & 1 deletion events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
*/
async execute(client) {
const logFile = await client.func.logUtils.readLog("v1/conf/status");
console.log(logFile);
const add = require(`../lib/commandUtils.js`);

add.addCmd(client);
Expand Down

0 comments on commit 69f4f94

Please sign in to comment.