-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit d082de6 Author: yanukadeneth99 <[email protected]> Date: Sun Aug 21 16:42:34 2022 +0530 Worked on getting the balance of goerli commit 4d83345 Author: yanukadeneth99 <[email protected]> Date: Sun Aug 21 15:34:47 2022 +0530 Worked on Feedback commit 84e42c8 Author: yanukadeneth99 <[email protected]> Date: Sun Aug 21 02:05:14 2022 +0530 Removed website command commit 1421fa9 Author: yanukadeneth99 <[email protected]> Date: Sun Aug 21 00:22:56 2022 +0530 Removed unwanted packages and moved to discord.js commit 4d897b0 Author: yanukadeneth99 <[email protected]> Date: Sun Aug 21 00:10:15 2022 +0530 Checking Webhook discord github commit bd0ddcb Author: yanukadeneth99 <[email protected]> Date: Sat Aug 20 23:30:42 2022 +0530 Updated code
- Loading branch information
1 parent
80c70a5
commit a771777
Showing
21 changed files
with
761 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// Exporting the Client | ||
|
||
const { Client, Intents } = require("discord.js"); | ||
const { Client, GatewayIntentBits } = require("discord.js"); | ||
|
||
// Create a new Client with these permissions | ||
const client = new Client({ intents: [Intents.FLAGS.GUILDS] }); | ||
const client = new Client({ intents: [GatewayIntentBits.Guilds] }); | ||
|
||
module.exports = client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Get the balance of the Address only for admins | ||
|
||
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); | ||
|
||
module.exports = { | ||
data: new SlashCommandBuilder() | ||
.setName("balance") | ||
.setDescription("Get the balance remaining of the contract") | ||
.setDMPermission(true) | ||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) | ||
.addStringOption((option) => | ||
option | ||
.setName("network") | ||
.setDescription("Select the network to view balance") | ||
.setRequired(true) | ||
.addChoices({ | ||
name: "Goerli", | ||
value: "goerli", | ||
}) | ||
) | ||
.addStringOption((option) => | ||
option | ||
.setName("token") | ||
.setDescription("Token Type to search") | ||
.setRequired(false) | ||
.addChoices({ | ||
name: "ETH", | ||
value: "eth", | ||
}) | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
// Respond user beep with Boop | ||
|
||
const { SlashCommandBuilder } = require("@discordjs/builders"); | ||
const { SlashCommandBuilder } = require("discord.js"); | ||
|
||
module.exports = { | ||
data: new SlashCommandBuilder() | ||
.setName("beep") | ||
.setDescription("Replies with boop!"), | ||
.setDescription("Replies with boop!") | ||
.setDMPermission(true), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Generate a Modal where you can enter your required eth | ||
// Address, Token(LINK, ETH, MATIC), Network(Mumbai,Rinkeby) | ||
|
||
const { SlashCommandBuilder } = require("discord.js"); | ||
|
||
module.exports = { | ||
data: new SlashCommandBuilder() | ||
.setName("feedback") | ||
.setDescription("Send Feedback to the Faucet Bot") | ||
.setDMPermission(true), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// Respond the user with the bot's ping | ||
|
||
const { SlashCommandBuilder } = require("@discordjs/builders"); | ||
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js"); | ||
|
||
module.exports = { | ||
data: new SlashCommandBuilder() | ||
.setName("ping") | ||
.setDescription("Check the ping of the bot (for admins only)"), | ||
.setDescription("Check the ping of the bot (for admins only)") | ||
.setDMPermission(true) | ||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! Run `node delete-commands.js` to delete all the commands | ||
|
||
const { REST } = require("@discordjs/rest"); | ||
const { Routes } = require("discord.js"); | ||
require("dotenv").config(); | ||
|
||
// Get the REST | ||
const rest = new REST({ version: "10" }).setToken(process.env.DCB_TOKEN); | ||
|
||
//* Use to remove all commands from the Guild | ||
// rest | ||
// .put( | ||
// Routes.applicationGuildCommands( | ||
// process.env.DCB_CLIENT_ID, | ||
// process.env.DCB_GUILD_ID | ||
// ), | ||
// { body: [] } | ||
// ) | ||
// .then(() => console.log("Successfully deleted all guild commands.")) | ||
// .catch(console.error); | ||
|
||
//* Use to remove all commands publically | ||
rest | ||
.put(Routes.applicationCommands(process.env.DCB_CLIENT_ID), { body: [] }) | ||
.then(() => console.log("Successfully deleted all application commands.")) | ||
.catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,43 @@ | ||
const fs = require("fs"); | ||
//? Run `node deploy-commands.js` to set the commands | ||
|
||
const fs = require("node:fs"); | ||
const path = require("node:path"); | ||
const { REST } = require("@discordjs/rest"); | ||
const { Routes } = require("discord-api-types/v9"); | ||
require("dotenv").config({ path: ".env" }); | ||
const { Routes } = require("discord.js"); | ||
require("dotenv").config(); | ||
|
||
// Get the commands from the `/commands` folder and to the array | ||
const commands = []; | ||
const commandsPath = path.join(__dirname, "commands"); | ||
const commandFiles = fs | ||
.readdirSync("./commands") | ||
.readdirSync(commandsPath) | ||
.filter((file) => file.endsWith(".js")); | ||
|
||
for (const file of commandFiles) { | ||
const command = require(`./commands/${file}`); | ||
const commandPath = path.join(commandsPath, file); | ||
const command = require(commandPath); | ||
commands.push(command.data.toJSON()); | ||
} | ||
|
||
const rest = new REST({ version: "9" }).setToken(process.env.DCB_TOKEN); | ||
// Get the REST | ||
const rest = new REST({ version: "10" }).setToken(process.env.DCB_TOKEN); | ||
|
||
//* Use for Development (Updates only the passed guild data) | ||
rest | ||
.put( | ||
Routes.applicationGuildCommands( | ||
process.env.DCB_CLIENT_ID, | ||
process.env.DCB_GUILD_ID | ||
), //* Use for Production | ||
//Routes.applicationCommands(process.env.DBC_CLIENT_ID) //* Use for Development as its updated instantly (no cache) | ||
), | ||
{ body: commands } | ||
) | ||
.then(() => console.log("Successfully registered application commands")) | ||
.catch(console.error); | ||
|
||
//* Use for Production as it updates the commands public | ||
// rest | ||
// .put(Routes.applicationCommands(process.env.DCB_CLIENT_ID), { | ||
// body: commands, | ||
// }) | ||
// .then(() => console.log("Successfully registered application commands")) | ||
// .catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.