Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Patreon Command and add a new patreon #394

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions src/commands/commandList/patreon/collectibles/candy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* OwO Bot for Discord
* Copyright (C) 2025 Christopher Thai
* This software is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
* For more information, see README.md and LICENSE
*/

const Collectible = require('./CollectibleInterface.js');

class Candy extends Collectible {
constructor() {
super();

this.key = 'candy';
this.alias = ['candy'];
this.singleName = 'candy';
this.pluralName = 'candies';
this.emoji = ''; // Replace with the actual emoji ID for Candy
this.owners = [
'768465041489657867',
'1096503254898180287'
];
this.fullControl = true;
this.ownerOnly = true;
this.giveAmount = 1;
this.description = `Sweet and bright, a joyful delight,\nA treat to savor, morning or night.\nCandy so fine, it’s truly divine,\nA moment of bliss, every time.\n\nSubcommands: owo candy combine`;
this.displayMsg = '?emoji? **| ?user?**, you have **?count? ?pluralName?** and **?mergeCount? Chocolate?mergePlural?**';
this.brokeMsg = ', you do not have any candies! >:c';
this.giveMsg = '?emoji? **| ?receiver?**, you have received **1 Candy** from **?giver?**';
this.hasManualMerge = true;
this.manualMergeCommands = ['combine'];
this.mergeNeeded = 3;
this.mergeEmoji = ''; // Replace with the actual emoji ID for Chocolate
this.mergeMsg =
'?emoji? **|** ?user? combined ?mergeNeeded? candies to make a **Chocolate**! Enjoy the sweetness! ?mergeEmoji? ';
this.manualMergeData = 'chocolate';
this.init();
}

async manualMerge(p) {
const { redis, msg } = p;

let count = (await redis.hget(`data_${msg.author.id}`, this.data)) || 0;

if (parseInt(count) < this.mergeNeeded) {
p.errorMsg(`, you need at least **${this.mergeNeeded} candies** to make a chocolate!`);
return;
}

await redis.hincrby(`data_${msg.author.id}`, this.data, -this.mergeNeeded);

await redis.hincrby(`data_${msg.author.id}`, this.manualMergeData, 1);

p.send(
this.mergeMsg.replace('?emoji?', this.emoji).replace('?mergeEmoji?', this.mergeEmoji).replace('?mergeNeeded?',this.mergeNeeded).replace('?user?', p.getName())
);
}
}

module.exports = new Candy();
42 changes: 37 additions & 5 deletions src/commands/commandList/patreon/collectibles/pikachu.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,52 @@ class Pikachu extends Collectible {
this.emoji = '<a:pikachu:1099236809390702612>';
this.owners = [
'768465041489657867',
'968621197011062804',
'879313703990870047',
'969176350621589514',
'968621197011062804',
'879313703990870047',
'969176350621589514',
'528801657111445544',
'956133987653398569'
];
this.fullControl = true;
this.ownerOnly = true;
this.giveAmount = 1;
this.description = `Charmeleons are red,\nWartortles are blue,\nIf you catch my heart,\nI’ll be your pikachu`;
this.displayMsg = '?emoji? **| ?user?**, you have **?count? Pikachu?plural?**';
this.description = `Charmeleons are red,\nWartortles are blue,\nIf you catch my heart,\nI’ll be your pikachu\n\nSubcommands: owo pikachu thunderstone`;
this.displayMsg = '?emoji? **| ?user?**, you have **?count? Pikachu?plural?** and **?mergeCount? Raichu?mergePlural?**';
this.brokeMsg = ', you do not have any Pikachus! >:c';
this.giveMsg = '?emoji? **| ?receiver?**, you have received **1 Pikachu** from **?giver?**';
this.hasManualMerge = true;
this.manualMergeCommands = ['thunderstone'];
this.mergeNeeded = 3;
this.mergeEmoji = ''; // Emoji Required

this.mergeMsg =
'?emoji? **|** ?user? used a thunderstone to evolve Pikachu into **Raichu**! It looks electrifying! ?mergeEmoji? ';
this.manualMergeData = 'raichu';
this.init();
}
async manualMerge(p) {
const { redis, msg } = p;

// Get the current count of Pikachus
let count = (await redis.hget(`data_${msg.author.id}`, this.data)) || 0;

// Check if the user has enough Pikachus to evolve
if (parseInt(count) < this.mergeNeeded) {
p.errorMsg(`, you need at least **${this.mergeNeeded} Pikachus** to evolve into Raichu!`);
return;
}

// Deduct the required Pikachus for evolution
await redis.hincrby(`data_${msg.author.id}`, this.data, -this.mergeNeeded);

// Add a Raichu
await redis.hincrby(`data_${msg.author.id}`, this.manualMergeData, 1);

// Send evolution message
p.send(
this.mergeMsg.replace('?emoji?', this.mergeEmoji).replace('?mergeEmoji?', this.mergeEmoji).replace('?user?', p.getName())
);
}
}

module.exports = new Pikachu();