make guild id and request channel id go into process environment
This commit is contained in:
parent
35726ad44a
commit
b21f6594a8
1 changed files with 4 additions and 7 deletions
|
|
@ -7,9 +7,6 @@ import {
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
|
|
||||||
const GUILD_ID = "1449756600733798501";
|
|
||||||
const REQUEST_CHANNEL_ID = "1449767378882920568";
|
|
||||||
|
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
intents: [GatewayIntentBits.Guilds],
|
intents: [GatewayIntentBits.Guilds],
|
||||||
});
|
});
|
||||||
|
|
@ -46,7 +43,7 @@ const rest = new REST({ version: "10" }).setToken(process.env.DISCORD_TOKEN);
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationGuildCommands(
|
Routes.applicationGuildCommands(
|
||||||
(await rest.get(Routes.oauth2CurrentApplication())).id,
|
(await rest.get(Routes.oauth2CurrentApplication())).id,
|
||||||
GUILD_ID
|
process.env.GUILD_ID
|
||||||
),
|
),
|
||||||
{ body: [command.toJSON()] }
|
{ body: [command.toJSON()] }
|
||||||
);
|
);
|
||||||
|
|
@ -123,7 +120,7 @@ client.on("interactionCreate", async interaction => {
|
||||||
if (!interaction.isChatInputCommand()) return;
|
if (!interaction.isChatInputCommand()) return;
|
||||||
if (interaction.commandName !== "request") return;
|
if (interaction.commandName !== "request") return;
|
||||||
|
|
||||||
if (interaction.guildId !== GUILD_ID) {
|
if (interaction.guildId !== process.env.GUILD_ID) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: "❌ This command can only be used in the main server.",
|
content: "❌ This command can only be used in the main server.",
|
||||||
flags: {
|
flags: {
|
||||||
|
|
@ -170,7 +167,7 @@ client.on("interactionCreate", async interaction => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const channel = await client.channels.fetch(REQUEST_CHANNEL_ID);
|
const channel = await client.channels.fetch(process.env.REQUEST_CHANNEL_ID);
|
||||||
|
|
||||||
await channel.send({
|
await channel.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
|
|
@ -207,7 +204,7 @@ client.on("interactionCreate", async interaction => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const channel = await client.channels.fetch(REQUEST_CHANNEL_ID);
|
const channel = await client.channels.fetch(process.env.REQUEST_CHANNEL_ID);
|
||||||
|
|
||||||
await channel.send({
|
await channel.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue