Skip to content

Commit

Permalink
Rebrand
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Oct 27, 2024
1 parent f44ef8d commit 232a57f
Show file tree
Hide file tree
Showing 88 changed files with 293 additions and 293 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Alice
# Mahiru

A rewrite version of [Elaina](https://github.com/NeroYuki/Elaina), a multipurpose Discord bot mainly made for [osu!droid](https://osudroid.moe/) and Malody. It is mainly designed for use in the [osu!droid International Discord server](https://discord.gg/nyD92cE).

Expand Down
Binary file added files/images/MahiruBeat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed files/images/alicecoin.png
Binary file not shown.
Binary file added files/images/embed-icon/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/images/embed-icon/image2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/images/embed-icon/image3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/images/embed-icon/image4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/images/embed-icon/image5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/images/embed-icon/image6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/images/embed-icon/image7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/images/embed-icon/image8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alice",
"name": "mahiru",
"version": "2024.523.0",
"description": "A Discord bot for osu!droid.",
"description": "A Discord bot.",
"main": "dist/main.js",
"scripts": {
"analyze-code": "npx eslint \"src/**\"",
Expand Down
2 changes: 1 addition & 1 deletion src/core/Bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class Bot extends Client<true> {
await this.registerDeployCommands();

consola.success("Discord API connection established");
consola.success("Alice Synthesis Thirty is up and running");
consola.success("Mahiru Shiina is up and running");
}

/**
Expand Down
52 changes: 25 additions & 27 deletions src/core/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,32 @@ export abstract class Config {
] as readonly Snowflake[];

static readonly activityList = [
["Underworld Console", ActivityType.Playing],
["Rulid Village", ActivityType.Watching],
["/help", ActivityType.Listening],
["Dark Territory", ActivityType.Watching],
["in Axiom church", ActivityType.Playing],
["with Integrity Knights", ActivityType.Playing],
["flowers from my beloved Fragnant Olive", ActivityType.Watching],
["Uncle Bercoulli's orders", ActivityType.Listening],
["Centoria", ActivityType.Watching],
["Human Empire", ActivityType.Watching],
["The Great War of Underworld", ActivityType.Competing],
] as readonly [string, Exclude<ActivityType, ActivityType.Custom>][];
["a sleepyhead Amane-kun", ActivityType.Watching],
["with cooking utensils", ActivityType.Playing],
["exercise tracks", ActivityType.Listening],
["Amane-kun's voice", ActivityType.Listening],
["with Amane-kun", ActivityType.Playing],
["with Amane-kun's hair", ActivityType.Playing],
["with Amane-kun's pampering", ActivityType.Playing],
["Amane-kun exercising", ActivityType.Watching],
["Amane-kun's cooking", ActivityType.Competing],
["with Chitose", ActivityType.Playing],
["with my flaxen hair", ActivityType.Playing],
["with Amane-kun's parents", ActivityType.Playing],
] satisfies [
string,
Exclude<ActivityType, ActivityType.Custom>,
][] as readonly [string, Exclude<ActivityType, ActivityType.Custom>][];

static readonly avatarList = [
"https://i.imgur.com/FAWi2Yl.png",
"https://i.imgur.com/Fspbt08.png",
"https://i.imgur.com/IXgYLNh.png",
"https://i.imgur.com/E7EbgS4.png",
"https://i.imgur.com/lFbSoEK.png",
"https://i.imgur.com/FJbkaPi.png",
"https://i.imgur.com/AaeiXgt.png",
"https://i.imgur.com/5yFCD3N.png",
"https://i.imgur.com/bXrgwzF.png",
"https://i.imgur.com/AYXXNS7.png",
"https://i.imgur.com/dtB1jf8.png",
"https://i.imgur.com/zSJuARr.png",
"https://i.imgur.com/ORVeEIS.jpg",
"https://i.imgur.com/luf34Ql.png",
"https://i.imgur.com/hAdTeAU.jpg",
] as readonly string[];
"https://i.imgur.com/39o5szl.png",
"https://i.imgur.com/93s2cua.png",
"https://i.imgur.com/H1nAm6w.png",
"https://i.imgur.com/q8SOh1v.png",
"https://i.imgur.com/NM6UcBA.png",
"https://i.imgur.com/Zi8kSsT.png",
"https://i.imgur.com/8tOuTpp.png",
"https://i.imgur.com/5lcnKcR.png",
] as const;
}
4 changes: 2 additions & 2 deletions src/core/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export class Constants {
static readonly uidMaxLimit = 500000;

/**
* The ID of the Alice coins emote.
* The ID of the Mahiru coins emote.
*/
static readonly aliceCoinEmote = "669532330980802561" satisfies Snowflake;
static readonly mahiruCoinEmote = "1300036693520289853" satisfies Snowflake;

/**
* The ID of the channel that is storing tag attachments.
Expand Down
2 changes: 1 addition & 1 deletion src/database/AliceDBCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class AliceDBCollection {

/**
* The database collection for information about Discord users regarding the bot
* (amount of Alice coins and its streak, daily/weekly challenges status, profile
* (amount of Mahiru coins and its streak, daily/weekly challenges status, profile
* picture format, etc).
*/
readonly playerInfo: PlayerInfoCollectionManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class PlayerInfoCollectionManager extends DatabaseCollectionManager<

override get defaultDocument(): DatabasePlayerInfo {
return {
alicecoins: 0,
coins: 0,
challenges: [],
discordid: "",
hasClaimedDaily: false,
Expand Down
6 changes: 3 additions & 3 deletions src/database/utils/aliceDb/Challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export class Challenge extends Manager {
{
$inc: {
points: this.isWeekly ? 50 : 25,
alicecoins: this.isWeekly ? 100 : 50,
coins: this.isWeekly ? 100 : 50,
},
},
);
Expand All @@ -412,7 +412,7 @@ export class Challenge extends Manager {
);

const coinEmoji = this.client.emojis.cache.get(
Constants.aliceCoinEmote,
Constants.mahiruCoinEmote,
)!;

await notificationChannel.send({
Expand All @@ -425,7 +425,7 @@ export class Challenge extends Manager {
this.isWeekly ? "50" : "25"
}\` points and ${coinEmoji}\`${
this.isWeekly ? "100" : "50"
}\` Alice coins!`,
}\` Mahiru coins!`,
),
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/database/utils/aliceDb/ClanAuction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ClanAuction extends Manager {
expirydate: number;

/**
* The minimum amount of Alice coins required to bid in this auction.
* The minimum amount of Mahiru coins required to bid in this auction.
*/
min_price: number;

Expand Down Expand Up @@ -83,7 +83,7 @@ export class ClanAuction extends Manager {
* Bids to the auction.
*
* @param clan The clan who bid.
* @param amount The amount of Alice coins to bid.
* @param amount The amount of Mahiru coins to bid.
* @returns An object containing information about the operation.
*/
bid(clan: Clan, amount: number): OperationResult {
Expand Down
4 changes: 2 additions & 2 deletions src/database/utils/aliceDb/MapShare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class MapShare extends Manager implements DatabaseMapShare {
{
projection: {
_id: 0,
alicecoins: 1,
coins: 1,
},
},
);
Expand All @@ -151,7 +151,7 @@ export class MapShare extends Manager implements DatabaseMapShare {
uid: bindInfo.uid,
username: bindInfo.username,
discordid: this.id,
alicecoins: coinAward,
coins: coinAward,
});
}

Expand Down
26 changes: 13 additions & 13 deletions src/database/utils/aliceDb/PlayerInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { OfficialDatabaseUser } from "@database/official/schema/OfficialDatabase
import { DroidHelper } from "@utils/helpers/DroidHelper";

/**
* Represents an information about a Discord user regarding the bot (amount of Alice coins and its streak, daily/weekly challenges status, profile picture format, etc).
* Represents an information about a Discord user regarding the bot (amount of Mahiru coins and its streak, daily/weekly challenges status, profile picture format, etc).
*/
export class PlayerInfo extends Manager {
/**
Expand Down Expand Up @@ -46,9 +46,9 @@ export class PlayerInfo extends Manager {
points: number;

/**
* The amount of Alice coins the user has.
* The amount of Mahiru coins the user has.
*/
alicecoins: number;
coins: number;

/**
* The amount of daily coins claim streak the user has.
Expand Down Expand Up @@ -84,7 +84,7 @@ export class PlayerInfo extends Manager {
isBannedFromMapShare: boolean;

/**
* The amount of Alice coins the user has transferred to other user.
* The amount of Mahiru coins the user has transferred to other user.
*/
transferred: number;

Expand All @@ -108,7 +108,7 @@ export class PlayerInfo extends Manager {
"id",
);
this.points = data.points;
this.alicecoins = data.alicecoins;
this.coins = data.coins;
this.streak = data.streak;
this.picture_config = data.picture_config;
this.dailyreset = data.dailyreset;
Expand All @@ -132,24 +132,24 @@ export class PlayerInfo extends Manager {
const localization: PlayerInfoLocalization =
this.getLocalization(language);

if (this.alicecoins + amount < 0) {
if (this.coins + amount < 0) {
// This would only happen if the amount incremented is negative
return this.createOperationResult(
false,
StringHelper.formatString(
localization.getTranslation("tooMuchCoinDeduction"),
this.alicecoins.toLocaleString(
this.coins.toLocaleString(
LocaleHelper.convertToBCP47(language),
),
),
);
}

this.alicecoins = Math.max(0, this.alicecoins + amount);
this.coins = Math.max(0, this.coins + amount);

return DatabaseManager.aliceDb.collections.playerInfo.updateOne(
{ discordid: this.discordid },
{ $set: { alicecoins: this.alicecoins } },
{ $set: { coins: this.coins } },
);
}

Expand All @@ -175,7 +175,7 @@ export class PlayerInfo extends Manager {

this.hasClaimedDaily = true;

this.alicecoins += coinAmount;
this.coins += coinAmount;

++this.streak;

Expand All @@ -187,7 +187,7 @@ export class PlayerInfo extends Manager {
{ discordid: this.discordid },
{
$inc: {
alicecoins: coinAmount,
coins: coinAmount,
},
$set: {
hasClaimedDaily: this.hasClaimedDaily,
Expand All @@ -202,7 +202,7 @@ export class PlayerInfo extends Manager {
*
* @param amount The amount of coins to transfer.
* @param thisPlayer The `Player` instance of this user.
* @param to The player to transfer the Alice coins to.
* @param to The player to transfer the Mahiru coins to.
* @param limit The limit of coins that can be transferred, if available.
* @param language The locale of the user who attempted the transfer. Defaults to English.
* @returns An object containing information about the operation.
Expand Down Expand Up @@ -263,7 +263,7 @@ export class PlayerInfo extends Manager {

await DatabaseManager.aliceDb.collections.playerInfo.updateOne(
{ discordid: this.discordid },
{ $inc: { transferred: amount, alicecoins: -amount } },
{ $inc: { transferred: amount, coins: -amount } },
);

return to.incrementCoins(amount);
Expand Down
8 changes: 6 additions & 2 deletions src/events/messageCreate/utils/8ball.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function getResponseType(

export const run: EventUtil["run"] = async (_, message: Message) => {
if (
(!message.content.startsWith("Alice, ") &&
(!message.content.startsWith("Mahiru, ") &&
!(
message.author.id === "386742340968120321" &&
message.content.startsWith("Dear, ")
Expand Down Expand Up @@ -90,6 +90,10 @@ export const run: EventUtil["run"] = async (_, message: Message) => {
answer = ArrayHelper.getRandomArrayElement(res.response);
}

if (!Config.botOwners.includes(message.author.id) && Math.random() < 0.1) {
answer = "No... you dummy.";
}

embed.setDescription(
`${bold("Q")}: ${message.content}\n${bold("A")}: ${answer}`,
);
Expand All @@ -107,7 +111,7 @@ export const run: EventUtil["run"] = async (_, message: Message) => {

export const config: EventUtil["config"] = {
description:
'Responsible for responding to questions prefixed with "Alice, ".',
'Responsible for responding to questions prefixed with "Mahiru, ".',
togglePermissions: ["ManageChannels"],
toggleScope: ["GLOBAL", "GUILD", "CHANNEL"],
};
4 changes: 2 additions & 2 deletions src/events/messageCreate/utils/chatCoins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const run: EventUtil["run"] = async (_, message: Message) => {
{
projection: {
_id: 0,
alicecoins: 1,
coins: 1,
},
},
);
Expand All @@ -73,7 +73,7 @@ export const run: EventUtil["run"] = async (_, message: Message) => {

export const config: EventUtil["config"] = {
description:
"Responsible for tracking Alice coins cooldown for users' chat activities.",
"Responsible for tracking Mahiru coins cooldown for users' chat activities.",
togglePermissions: ["BotOwner"],
toggleScope: ["GLOBAL"],
};
2 changes: 1 addition & 1 deletion src/events/ready/utils/birthdayTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const run: EventUtil["run"] = async (client) => {

await DatabaseManager.aliceDb.collections.playerInfo.updateOne(
{ discordid: user.id },
{ $inc: { alicecoins: 1000 } },
{ $inc: { coins: 1000 } },
);
}
}, 20 * 1000);
Expand Down
4 changes: 2 additions & 2 deletions src/events/ready/utils/clanAuctionTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CommandUtilManager } from "@utils/managers/CommandUtilManager";

export const run: EventUtil["run"] = async (client) => {
const coinEmoji: GuildEmoji = client.emojis.cache.get(
Constants.aliceCoinEmote,
Constants.mahiruCoinEmote,
)!;
const notificationChannel: TextChannel = <TextChannel>(
await client.channels.fetch("696646867567640586")
Expand Down Expand Up @@ -80,7 +80,7 @@ export const run: EventUtil["run"] = async (client) => {

embed.addFields({
name: "Winner",
value: `${winnerClan.name} - \`${bidArray[bidIndex].amount}\` Alice coins`,
value: `${winnerClan.name} - \`${bidArray[bidIndex].amount}\` Mahiru coins`,
});

await notificationChannel.send({
Expand Down
8 changes: 4 additions & 4 deletions src/events/ready/utils/clanWeeklyFeeTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,23 @@ export const run: EventUtil["run"] = async (client) => {
{
projection: {
_id: 0,
alicecoins: 1,
coins: 1,
},
},
);

if (!memberPlayerInfo) {
// Clan member doesn't have any Alice coins info, possibly being banned from the server or the game.
// Clan member doesn't have any Mahiru coins info, possibly being banned from the server or the game.
// In that case, simply kick.
await clan.removeMember(member.id, language);
++kickedCount;
continue;
}

const coins: number = memberPlayerInfo.alicecoins;
const coins: number = memberPlayerInfo.coins;

if (coins < upkeep) {
// Clan member doesn't have enough Alice coins to pay upkeep.
// Clan member doesn't have enough Mahiru coins to pay upkeep.
// If the penalized member is the leader, kick a random member.
let userToKick: Snowflake = member.id;
let kickedGuildMember: GuildMember | undefined =
Expand Down
Loading

0 comments on commit 232a57f

Please sign in to comment.