forked from Pogy-Bot/Pogy
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
3,561 additions
and
2,460 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,42 @@ | ||
const Command = require("../../structures/Command"); | ||
|
||
|
||
module.exports = class EmptyCommand extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "wouldyourather", | ||
aliases: [], | ||
description: "wouldyourather", | ||
category: "General", | ||
cooldown: 5, | ||
|
||
}); | ||
} | ||
|
||
async run(message) { | ||
try { | ||
const { WouldYouRather } = require('falgames'); | ||
const Game = new WouldYouRather({ | ||
message: message, | ||
isSlashGame: false, | ||
embed: { | ||
title: 'Would You Rather', | ||
color: '#551476', | ||
|
||
}, | ||
buttons: { | ||
option1: 'Option 1', | ||
option2: 'Option 2', | ||
}, | ||
timeoutTime: 60000, | ||
errMessage: 'Unable to fetch question data! Please try again.', | ||
playerOnlyMessage: 'Only {player} can use these buttons.' | ||
}); | ||
|
||
Game.startGame(); | ||
} catch (error) { | ||
console.error("Error in the empty command:", error); | ||
message.channel.send("An error occurred. Please try again later."); | ||
} | ||
} | ||
}; |
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,55 @@ | ||
// ProfileCommand.js | ||
const Command = require("../../structures/Command"); | ||
const fs = require("fs"); | ||
const { MessageEmbed } = require("discord.js"); | ||
|
||
module.exports = class ProfileCommand extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "profile", | ||
aliases: ["myprofile"], | ||
description: "View or update your profile.", | ||
category: "User", | ||
cooldown: 5, | ||
}); | ||
} | ||
|
||
async run(message, args) { | ||
try { | ||
// Load existing profiles from JSON file | ||
let profiles = {}; | ||
if (fs.existsSync("/home/vboxuser/Pogy-3/src/data/profiles.json")) { | ||
const data = fs.readFileSync("/home/vboxuser/Pogy-3/src/data/profiles.json"); | ||
profiles = JSON.parse(data); | ||
} | ||
|
||
// Get member ID | ||
const memberId = message.author.id; | ||
|
||
// Check if the member has a profile | ||
if (!profiles[memberId]) { | ||
// Create a new profile if not exists | ||
profiles[memberId] = { | ||
username: message.author.username, | ||
points: 0, | ||
// Add more profile fields as needed | ||
}; | ||
} | ||
|
||
// Display the member's profile card | ||
const profileEmbed = new MessageEmbed() | ||
.setTitle(`${message.author.username}'s Profile`) | ||
.addField("Points") | ||
// Add more fields as needed | ||
.setColor("#3498db"); // Set the embed color | ||
|
||
message.channel.send(profileEmbed); | ||
|
||
// Save updated profiles to JSON file | ||
fs.writeFileSync("profiles.json", JSON.stringify(profiles, null, 2)); | ||
} catch (error) { | ||
console.error("Error in the profile command:", error); | ||
message.channel.send("An error occurred. Please try again later."); | ||
} | ||
} | ||
}; |
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,62 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const Command = require("../../structures/Command"); | ||
|
||
module.exports = class SetupStickyCommand extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "setupsticky", | ||
aliases: ["setsticky"], | ||
description: "Set up a sticky message in the current channel.", | ||
category: "Moderation", | ||
cooldown: 5, | ||
guildOnly: true, | ||
permissions: ["MANAGE_MESSAGES"], | ||
}); | ||
} | ||
|
||
async run(message, args) { | ||
try { | ||
const guildId = message.guild.id; | ||
const stickyDataDir = path.join(__dirname, '..', '..', 'data', 'stickyData'); | ||
const filePath = path.join(stickyDataDir, `${guildId}.json`); | ||
|
||
if (!fs.existsSync(stickyDataDir)) { | ||
fs.mkdirSync(stickyDataDir, { recursive: true }); | ||
} | ||
|
||
let stickyData = {}; | ||
|
||
if (fs.existsSync(filePath)) { | ||
stickyData = JSON.parse(fs.readFileSync(filePath)); | ||
} | ||
|
||
const stickyContent = args.join(' ') || 'This is a sticky message!'; | ||
const stickyChannelId = message.channel.id; | ||
|
||
// Delete the previous sticky message if exists | ||
const currentStickyMessageId = stickyData[stickyChannelId]; | ||
if (currentStickyMessageId) { | ||
const previousStickyMessage = await message.channel.messages.fetch(currentStickyMessageId); | ||
if (previousStickyMessage) { | ||
await previousStickyMessage.delete(); | ||
} | ||
} | ||
|
||
// Send the new sticky message | ||
const newStickyMessage = await message.channel.send(stickyContent); | ||
stickyData[stickyChannelId] = newStickyMessage.id; | ||
stickyData[`${stickyChannelId}_content`] = stickyContent; // Store the content in the data | ||
saveStickyData(filePath, stickyData); | ||
|
||
message.channel.send("Sticky message has been set up!"); | ||
} catch (error) { | ||
console.error("Error in the setupsticky command:", error); | ||
message.channel.send("An error occurred. Please try again later."); | ||
} | ||
} | ||
}; | ||
|
||
function saveStickyData(filePath, data) { | ||
fs.writeFileSync(filePath, JSON.stringify(data, null, 2)); | ||
} |
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,58 @@ | ||
const Command = require("../../structures/Command"); | ||
const Discord = require('discord.js'); // Import the Discord.js library | ||
|
||
const prefix = '!'; // Set your desired prefix | ||
|
||
module.exports = class EmptyCommand extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "empty2", | ||
aliases: [], | ||
description: "Empty command template.", | ||
category: "General", | ||
cooldown: 5, | ||
}); | ||
} | ||
|
||
async run(message) { | ||
try { | ||
const gridSize = 10; | ||
let gameGrid = Array.from(Array(gridSize), () => new Array(gridSize).fill('◻️')); | ||
|
||
// Create a new Discord.Client instance | ||
const msg = message.channel | ||
startTetrisGame(msg.channel); | ||
|
||
function startTetrisGame(channel) { | ||
// Initialize game state and send the initial game grid | ||
gameGrid = Array.from(Array(gridSize), () => new Array(gridSize).fill('◻️')); | ||
sendGameGrid(channel); | ||
|
||
// Game loop | ||
const gameInterval = setInterval(() => { | ||
// Update game state here | ||
// Check for user input, move pieces, update grid, etc. | ||
|
||
// Send updated game grid | ||
sendGameGrid(channel); | ||
}, 1000); // Update every second | ||
|
||
// End the game after a certain time or condition | ||
setTimeout(() => { | ||
clearInterval(gameInterval); | ||
channel.send('Game Over!'); | ||
}, 60000); // End the game after 60 seconds | ||
} | ||
|
||
function sendGameGrid(channel) { | ||
const gameMessage = gameGrid.map(row => row.join('')).join('\n'); | ||
channel.send(`\`\`\`${gameMessage}\`\`\``); | ||
} | ||
|
||
// Log in to Discord with the bot token | ||
} catch (error) { | ||
console.error("Error in the empty command:", error); | ||
message.channel.send("An error occurred. Please try again later."); | ||
} | ||
} | ||
}; |
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,47 @@ | ||
// HideChannelsCommand.js | ||
const Command = require("../../structures/Command"); | ||
const { createAudioPlayer, joinVoiceChannel, createAudioResource } = require('@discordjs/voice'); | ||
const { createReadStream } = require('fs'); | ||
const path = require('path'); | ||
module.exports = class HideChannelsCommand extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "hidechannels", | ||
aliases: ["hidechans"], | ||
description: "Hide all channels from regular members, making them visible only to owners and admins.", | ||
category: "Moderation", | ||
cooldown: 10, | ||
// Add any other command options or configurations | ||
}); | ||
} | ||
|
||
async run(message) { | ||
try { | ||
|
||
// Fetch all channels in the server | ||
const channels = message.guild.channels.cache; | ||
|
||
// Iterate through each channel and update permissions | ||
channels.forEach(async (channel) => { | ||
try { | ||
// Check if the channel is a text or voice channel | ||
if (channel.type === "text" || channel.type === "voice") { | ||
await channel.updateOverwrite(message.guild.roles.everyone, { VIEW_CHANNEL: false }); | ||
await channel.updateOverwrite(message.guild.ownerID, { VIEW_CHANNEL: true }); | ||
// You can add more roles (like admin roles) if needed | ||
|
||
message.channel.send(`Channel ${channel.name} is now visible only to owners and admins.`); | ||
} | ||
} catch (error) { | ||
console.error(`Error updating channel permissions for ${channel.name}:`, error); | ||
message.channel.send(`An error occurred while updating permissions for ${channel.name}.`); | ||
} | ||
}); | ||
|
||
message.channel.send("All channels have been hidden from regular members."); | ||
} catch (error) { | ||
console.error("Error in the hidechannels command:", error); | ||
message.channel.send("An error occurred. Please try again later."); | ||
} | ||
} | ||
}; |
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,27 @@ | ||
// EmptyCommand.js | ||
const Command = require("../../structures/Command"); | ||
// Add any additional dependencies or modules as needed | ||
|
||
module.exports = class EmptyCommand extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "slowmode", | ||
aliases: [], | ||
description: "Sets the slow mode of the current channel", | ||
category: "Moderation", | ||
cooldown: 5, | ||
|
||
}); | ||
} | ||
|
||
async run(message) { | ||
try { | ||
const test = message.content.split(" "); | ||
|
||
message.channel.send("This is an empty command template. Implement your logic here." + test[1]); | ||
} catch (error) { | ||
console.error("Error in the empty command:", error); | ||
message.channel.send("An error occurred. Please try again later."); | ||
} | ||
} | ||
}; |
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,63 @@ | ||
const { MessageActionRow, MessageButton } = require('discord.js'); | ||
const Command = require("../../structures/Command"); | ||
|
||
module.exports = class MadCommand extends Command { | ||
constructor(...args) { | ||
super(...args, { | ||
name: "mad", | ||
aliases: [], | ||
description: "Create a Mad Libs story.", | ||
category: "Fun", | ||
cooldown: 5, | ||
}); | ||
} | ||
|
||
async run(message) { | ||
const collectedWords = { | ||
noun: "", | ||
verb: "", | ||
adjective: "", | ||
}; | ||
|
||
const askForWord = async (wordType) => { | ||
const row = new MessageActionRow().addComponents( | ||
new MessageButton().setCustomId(`confirm_${wordType}`).setLabel('Confirm').setStyle('SUCCESS'), | ||
new MessageButton().setCustomId(`retry_${wordType}`).setLabel('Retry').setStyle('PRIMARY'), | ||
); | ||
|
||
const sentMessage = await message.channel.send(`Enter a ${wordType}:`, { components: [row] }); | ||
|
||
const filter = (i) => i.user.id === message.author.id; | ||
const collector = sentMessage.createMessageComponentCollector({ filter, time: 30000 }); | ||
|
||
return new Promise((resolve, reject) => { | ||
collector.on('collect', async (i) => { | ||
if (i.customId === `confirm_${wordType}`) { | ||
collector.stop(); | ||
resolve(collectedWords[wordType]); | ||
} else if (i.customId === `retry_${wordType}`) { | ||
collector.stop(); | ||
const response = await askForWord(wordType); | ||
collectedWords[wordType] = response; | ||
} | ||
}); | ||
|
||
collector.on('end', (collected, reason) => { | ||
if (reason === 'time') { | ||
reject(`Time is up! ${wordType} not provided.`); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
// Ask for each word type | ||
collectedWords.noun = await askForWord("noun"); | ||
collectedWords.verb = await askForWord("verb"); | ||
collectedWords.adjective = await askForWord("adjective"); | ||
|
||
// Display the Mad Libs story | ||
if (collectedWords.noun && collectedWords.verb && collectedWords.adjective) { | ||
message.channel.send(`The ${collectedWords.adjective} ${collectedWords.noun} ${collectedWords.verb} and was very ${collectedWords.adjective}.`); | ||
} | ||
} | ||
}; |
Oops, something went wrong.