forked from ChrisChrome/weather-bot
Update config.json.template and index.js with Discord owner, mainGuild, and inviteChannel IDs
This commit is contained in:
parent
8064cf083c
commit
f328ba7d9c
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"discord": {
|
"discord": {
|
||||||
"token": "YOUR_TOKEN",
|
"token": "YOUR_TOKEN",
|
||||||
"owner": "289884287765839882"
|
"owner": "your_user_id",
|
||||||
|
"mainGuild": "your_guild_id",
|
||||||
|
"inviteChannel": "your_channel_id"
|
||||||
},
|
},
|
||||||
"ntfy": {
|
"ntfy": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|
21
index.js
21
index.js
|
@ -377,6 +377,11 @@ discord.on('ready', async () => {
|
||||||
"description": "[OWNER ONLY] Setup channels in a category for all rooms",
|
"description": "[OWNER ONLY] Setup channels in a category for all rooms",
|
||||||
"default_member_permissions": 0,
|
"default_member_permissions": 0,
|
||||||
"type": 1
|
"type": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "support",
|
||||||
|
"description": "Get support for the bot",
|
||||||
|
"type": 1
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -546,10 +551,8 @@ discord.on("interactionCreate", async (interaction) => {
|
||||||
interaction.reply({ embeds, ephemeral: true });
|
interaction.reply({ embeds, ephemeral: true });
|
||||||
break;
|
break;
|
||||||
case "setupall":
|
case "setupall":
|
||||||
if (!interaction.member.user.id === config.discord.owner) {
|
if (!config.discord.owner) return interaction.reply({ content: "Owner not set in config", ephemeral: true });
|
||||||
interaction.reply({ content: "You are not the bot owner", ephemeral: true });
|
if (interaction.user.id !== config.discord.owner) return interaction.reply({ content: "You are not the owner", ephemeral: true });
|
||||||
return;
|
|
||||||
};
|
|
||||||
interaction.deferReply({ ephemeral: true })
|
interaction.deferReply({ ephemeral: true })
|
||||||
var category;
|
var category;
|
||||||
|
|
||||||
|
@ -594,6 +597,16 @@ discord.on("interactionCreate", async (interaction) => {
|
||||||
});
|
});
|
||||||
interaction.editReply({ content: "Setup complete", ephemeral: true });
|
interaction.editReply({ content: "Setup complete", ephemeral: true });
|
||||||
break;
|
break;
|
||||||
|
case "support":
|
||||||
|
// Generate an invite link to the support server (use widget channel)
|
||||||
|
const invite = await discord.guilds.cache.get(config.discord.mainGuild).channels.cache.get(config.discord.inviteChannel).createInvite();
|
||||||
|
const embed = {
|
||||||
|
title: "Support Server",
|
||||||
|
description: `Need help with the bot? Join the support server [here](${invite.url})`,
|
||||||
|
color: 0x00ff00
|
||||||
|
}
|
||||||
|
interaction.reply({ embeds: [embed] });
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue