Full Code of sabattle/CalypsoBot for AI

main db016cc48a9f cached
77 files
150.0 KB
38.2k tokens
41 symbols
1 requests
Download .txt
Repository: sabattle/CalypsoBot
Branch: main
Commit: db016cc48a9f
Files: 77
Total size: 150.0 KB

Directory structure:
gitextract_k5hgb30w/

├── .commitlintrc.json
├── .devcontainer/
│   ├── Dockerfile
│   └── devcontainer.json
├── .eslintrc
├── .github/
│   └── workflows/
│       └── node.js.yml
├── .gitignore
├── .husky/
│   ├── commit-msg
│   ├── pre-commit
│   └── prepare-commit-msg
├── .prettierrc
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   └── settings.json
├── LICENSE
├── README.md
├── deploy.ts
├── package.json
├── prisma/
│   └── schema.prisma
├── src/
│   ├── app.ts
│   ├── commands/
│   │   ├── animals/
│   │   │   ├── bird.ts
│   │   │   ├── cat.ts
│   │   │   ├── catfact.ts
│   │   │   ├── dog.ts
│   │   │   ├── dogfact.ts
│   │   │   ├── duck.ts
│   │   │   ├── fox.ts
│   │   │   └── shibe.ts
│   │   ├── color/
│   │   │   ├── color.ts
│   │   │   └── randomcolor.ts
│   │   ├── fun/
│   │   │   ├── coinflip.ts
│   │   │   ├── meme.ts
│   │   │   ├── thouart.ts
│   │   │   ├── wholesomememe.ts
│   │   │   ├── yesno.ts
│   │   │   └── yomama.ts
│   │   ├── information/
│   │   │   ├── avatar.ts
│   │   │   ├── botinfo.ts
│   │   │   ├── botstats.ts
│   │   │   ├── channelinfo.ts
│   │   │   ├── donate.ts
│   │   │   ├── findid.ts
│   │   │   ├── github.ts
│   │   │   ├── help.ts
│   │   │   ├── inviteme.ts
│   │   │   ├── memberstatus.ts
│   │   │   ├── permissions.ts
│   │   │   ├── ping.ts
│   │   │   ├── roleinfo.ts
│   │   │   ├── servericon.ts
│   │   │   ├── serverinfo.ts
│   │   │   ├── supportserver.ts
│   │   │   ├── uptime.ts
│   │   │   └── userinfo.ts
│   │   └── miscellaneous/
│   │       ├── feedback.ts
│   │       └── reportbug.ts
│   ├── components/
│   │   └── selectMenus/
│   │       └── help.ts
│   ├── config.ts
│   ├── enums.ts
│   ├── events/
│   │   ├── debug.ts
│   │   ├── error.ts
│   │   ├── guildCreate.ts
│   │   ├── interactionCreate.ts
│   │   ├── messageCreate.ts
│   │   ├── ready.ts
│   │   └── warn.ts
│   ├── logger.ts
│   ├── prisma.ts
│   ├── structures/
│   │   ├── Client.ts
│   │   ├── Command.ts
│   │   ├── Component.ts
│   │   ├── ConfigCache.ts
│   │   ├── Event.ts
│   │   ├── PaginatedEmbed.ts
│   │   └── index.ts
│   ├── types.ts
│   └── utils.ts
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .commitlintrc.json
================================================
{
  "extends": ["@commitlint/config-conventional"]
}


================================================
FILE: .devcontainer/Dockerfile
================================================
ARG VARIANT=18-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# Install packages
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends \
    vim \
    tree

================================================
FILE: .devcontainer/devcontainer.json
================================================
{
  "name": "CalypsoBot Dev Container",
  "build": {
    "dockerfile": "Dockerfile",
    "args": {
      "VARIANT": "18-bullseye"
    }
  },
  "settings": {
    "terminal.integrated.profiles.linux": {
      "zsh": {
        "path": "/usr/bin/zsh"
      }
    },
    "terminal.integrated.defaultProfile.linux": "zsh"
  },
  "customizations": {
    "vscode": {
      "extensions": [
        "dbaeumer.vscode-eslint",
        "esbenp.prettier-vscode",
        "streetsidesoftware.code-spell-checker",
        "Prisma.prisma"
      ]
    }
  },
  "remoteUser": "node",
  "features": {
    "git": "latest"
  }
}


================================================
FILE: .eslintrc
================================================
{
  "root": true,
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": 12,
    "sourceType": "module",
    "project": ["./tsconfig.json"]
  },
  "plugins": ["@typescript-eslint", "import", "eslint-plugin-tsdoc"],
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "plugin:@typescript-eslint/strict",
    "plugin:import/recommended",
    "plugin:import/typescript",
    "prettier"
  ],
  "rules": {
    "prefer-destructuring": ["error", { "object": true, "array": false }],
    "@typescript-eslint/no-unused-vars": "error",
    "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
    "@typescript-eslint/explicit-function-return-type": "error",
    "@typescript-eslint/explicit-member-accessibility": "error",
    "@typescript-eslint/no-floating-promises": [
      "error",
      { "ignoreIIFE": true }
    ],
    "@typescript-eslint/restrict-template-expressions": "off",
    "@typescript-eslint/no-base-to-string": "off",
    "@typescript-eslint/consistent-type-imports": "warn",
    "import/no-named-as-default": "off",
    "sort-imports": [
      "error",
      {
        "allowSeparatedGroups": true,
        "ignoreCase": false,
        "ignoreDeclarationSort": true,
        "ignoreMemberSort": false,
        "memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
      }
    ],
    "tsdoc/syntax": "warn"
  },
  "settings": {
    "import/resolver": {
      "typescript": {
        "project": "./tsconfig.json"
      }
    }
  },
  "env": {
    "browser": false,
    "node": true
  }
}


================================================
FILE: .github/workflows/node.js.yml
================================================
name: Node.js CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  ci:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [18.x]

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Build
        run: npm run build

      - name: Lint
        run: npm run lint

      - name: Check format
        run: npm run check


================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

================================================
FILE: .husky/commit-msg
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit $1


================================================
FILE: .husky/pre-commit
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged


================================================
FILE: .husky/prepare-commit-msg
================================================
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

if [ -z "${2-}" ]; then
  exec < /dev/tty && node_modules/.bin/cz --hook
fi


================================================
FILE: .prettierrc
================================================
{
  "trailingComma": "all",
  "tabWidth": 2,
  "bracketSpacing": true,
  "semi": false,
  "singleQuote": true
}


================================================
FILE: .vscode/extensions.json
================================================
{
  "recommendations": [
    "dbaeumer.vscode-eslint",
    "esbenp.prettier-vscode",
    "streetsidesoftware.code-spell-checker",
    "Prisma.prisma"
  ]
}


================================================
FILE: .vscode/launch.json
================================================
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug",
      "type": "node",
      "request": "launch",
      "runtimeArgs": [
        "-r",
        "ts-node/register",
        "-r",
        "tsconfig-paths/register"
      ],
      "args": ["src/app.ts"],
      "cwd": "${workspaceFolder}",
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen",
      "env": {
        "TS_NODE_PROJECT": "tsconfig.json",
        "TS_NODE_TRANSPILE_ONLY": "true"
      }
    }
  ]
}


================================================
FILE: .vscode/settings.json
================================================
{
  "editor.tabSize": 2,
  "editor.insertSpaces": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "[prisma]": {
    "editor.defaultFormatter": "Prisma.prisma"
  },
  "cSpell.enabled": true,
  "cSpell.words": [
    "botinfo",
    "botstats",
    "bugreport",
    "catfact",
    "channelinfo",
    "coinflip",
    "commitlint",
    "dankmemes",
    "discordjs",
    "dogfact",
    "findid",
    "IIFE",
    "inviteme",
    "memberstatus",
    "precommit",
    "randomcolor",
    "reportbug",
    "roleinfo",
    "Seagrass",
    "servericon",
    "serverinfo",
    "Shiba",
    "shibe",
    "subreddits",
    "supportserver",
    "thouart",
    "tsdoc",
    "unvalidated",
    "wholesomememe",
    "wholesomememes",
    "yesno",
    "yomama"
  ]
}


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

                            Preamble

The GNU General Public License is a free, copyleft license for
software and other kinds of works.

The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.

When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.

Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

0. Definitions.

"This License" refers to version 3 of the GNU General Public License.

"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.

To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

A "covered work" means either the unmodified Program or a work based
on the Program.

To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

1. Source Code.

The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.

A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

The Corresponding Source for a work in source code form is that
same work.

2. Basic Permissions.

All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.

3. Protecting Users' Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

5. Conveying Modified Source Versions.

You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

6. Conveying Non-Source Forms.

You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

7. Additional Terms.

"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

8. Termination.

You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

9. Acceptance Not Required for Having Copies.

You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

10. Automatic Licensing of Downstream Recipients.

Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.

An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

11. Patents.

A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".

A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

12. No Surrender of Others' Freedom.

If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

13. Use with the GNU Affero General Public License.

Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

17. Interpretation of Sections 15 and 16.

If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    CalypsoBot - A fully customizable bot built with discord.js
    Copyright (C) 2018-2022  Sebastian Battle

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    CalypsoBot  Copyright (C) 2018-2022  Sebastian Battle
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
<h1 align="center">
  <br>
  <a href="https://github.com/sabattle/CalypsoBot"><img src="./images/Calypso_Title.png"></a>
  <br>
  Calypso Discord Bot
  <br>
</h1>

<h3 align=center>A fully customizable bot built with <a href=https://github.com/discordjs/discord.js>discord.js</a></h3>

<div align=center>

  <a href="https://discord.gg/9SpsSG5VWh">
    <img src="https://discordapp.com/api/guilds/709992782252474429/widget.png?style=shield" alt="shield.png">
  </a>

  <a href="https://github.com/discordjs">
    <img src="https://img.shields.io/badge/discord.js-v14.6.0-blue.svg?logo=npm" alt="shield.png">
  </a>

  <a href="https://github.com/sabattle/CalypsoBot/blob/develop/LICENSE">
    <img src="https://img.shields.io/badge/license-GNU%20GPL%20v3-green" alt="shield.png">
  </a>

</div>

## Calypso is undergoing a complete rewrite. What you see here is heavily WIP. You may be looking for the old (outdated) version of Calypso, [here](https://github.com/sabattle/CalypsoBot/tree/archive)


================================================
FILE: deploy.ts
================================================
import { REST } from '@discordjs/rest'
import { Routes } from 'discord-api-types/v10'
import logger from 'logger'
import config from 'config'
import { basename, sep } from 'path'
import { promisify } from 'util'
import glob from 'glob'
import { type RESTPostAPIChatInputApplicationCommandsJSONBody } from 'discord.js'
import type { StructureImport } from 'types'
import type { Command } from '@structures'

const { token, clientId, guildId } = config

const glob_ = promisify(glob)

const _loadCommands = async (): Promise<
  RESTPostAPIChatInputApplicationCommandsJSONBody[]
> => {
  const commands: RESTPostAPIChatInputApplicationCommandsJSONBody[] = []
  const files = await glob_(
    `${__dirname.split(sep).join('/')}/src/commands/*/*{.ts,.js}`,
  )
  if (files.length === 0) {
    logger.warn('No commands found')
    return commands
  }

  for (const f of files) {
    const name = basename(f, '.ts')
    try {
      const command = ((await import(f)) as StructureImport<Command>).default
      commands.push(command.data.toJSON())
    } catch (err) {
      if (err instanceof Error) {
        logger.error(`Command failed to import: ${name}`)
        logger.error(err.stack)
      } else logger.error(err)
    }
  }

  return commands
}

const rest = new REST({ version: '10' }).setToken(token)

logger.info('Deploying commands...')

const applicationCommands =
  process.env.NODE_ENV === 'production'
    ? Routes.applicationCommands(clientId)
    : Routes.applicationGuildCommands(clientId, guildId)

;(async (): Promise<void> => {
  try {
    const commands = await _loadCommands()
    await rest.put(applicationCommands, { body: commands })
    logger.info(`Commands successfully deployed`)
  } catch (err) {
    if (err instanceof Error) logger.error(err.stack)
    else logger.error(err)
  }
})()


================================================
FILE: package.json
================================================
{
  "name": "calypso-bot",
  "version": "0.0.1",
  "description": "A fully customizable bot built with discord.js",
  "main": "app.ts",
  "engines": {
    "node": ">=18.12.0"
  },
  "dependencies": {
    "@discordjs/rest": "^1.3.0",
    "@prisma/client": "^4.6.0",
    "chalk": "^4.1.2",
    "cli-table3": "^0.6.3",
    "common-tags": "^1.8.2",
    "dayjs": "^1.11.6",
    "discord.js": "^14.6.0",
    "dotenv": "^16.0.1",
    "glob": "^8.0.3",
    "lodash": "^4.17.21",
    "node-fetch": "^2.6.7",
    "winston": "^3.8.2",
    "yargs": "^17.6.2"
  },
  "devDependencies": {
    "@commitlint/cli": "^17.0.3",
    "@commitlint/config-conventional": "^17.0.3",
    "@types/common-tags": "^1.8.1",
    "@types/glob": "^8.0.0",
    "@types/lodash": "^4.14.187",
    "@types/node": "^18.0.4",
    "@types/node-fetch": "^2.6.2",
    "@types/yargs": "^17.0.13",
    "@typescript-eslint/eslint-plugin": "^5.30.7",
    "@typescript-eslint/parser": "^5.30.7",
    "commitizen": "^4.2.5",
    "cross-env": "^7.0.3",
    "cz-conventional-changelog": "^3.3.0",
    "eslint": "^8.20.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-import-resolver-typescript": "^3.5.2",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-tsdoc": "^0.2.17",
    "husky": "8.0.1",
    "lint-staged": "13.0.3",
    "prettier": "2.7.1",
    "prisma": "^4.6.0",
    "ts-node": "^10.9.1",
    "ts-node-dev": "^2.0.0",
    "tsconfig-paths": "^4.1.0",
    "tslib": "^2.4.0",
    "typescript": "^4.7.4"
  },
  "scripts": {
    "start": "cross-env NODE_ENV=development ts-node src/app.ts",
    "start:dev": "cross-env NODE_ENV=development ts-node-dev --exit-child -r tsconfig-paths/register src/app.ts",
    "start:debug": "cross-env NODE_ENV=development ts-node-dev -r tsconfig-paths/register src/app.ts --debug",
    "start:prod": "cross-env NODE_ENV=production TS_NODE_BASEURL=dist/src node -r tsconfig-paths/register dist/src/app.js",
    "deploy": "cross-env NODE_ENV=development ts-node deploy.ts",
    "deploy:dev": "npm run deploy",
    "deploy:prod": "cross-env NODE_ENV=production ts-node deploy.ts",
    "build": "tsc",
    "watch": "tsc -w",
    "lint": "eslint --ext .js,.ts src",
    "lint:fix": "eslint --ext .js,.ts --fix src",
    "check": "prettier --ignore-path .gitignore --check .",
    "format": "prettier --ignore-path .gitignore --write .",
    "precommit": "npx lint-staged",
    "prepare": "husky install"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/sabattle/CalypsoBot.git"
  },
  "author": "Sebastian Battle",
  "license": "GPL-3.0",
  "bugs": {
    "url": "https://github.com/sabattle/CalypsoBot/issues"
  },
  "homepage": "https://github.com/sabattle/CalypsoBot#readme",
  "lint-staged": {
    "**/*.{js,ts}": "eslint --ext .js,.ts",
    "**/*.{js,ts,json,md}": "prettier --ignore-path .gitignore --write"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}


================================================
FILE: prisma/schema.prisma
================================================
datasource db {
  provider = "mongodb"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

model Guild {
  id      String @id @default(auto()) @map("_id") @db.ObjectId
  guildId String @unique
  name    String
  config  Config

  @@map("guilds")
}

type Config {
  colorRolePrefix String @default("#")
}


================================================
FILE: src/app.ts
================================================
import { Client } from '@structures'
import config from 'config'
import { GatewayIntentBits, Partials } from 'discord.js'

const client = new Client(config, {
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildPresences,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.DirectMessages,
  ],
  partials: [Partials.Channel],
})

// Initialize bot
;(async (): Promise<void> => await client.init())()


================================================
FILE: src/commands/animals/bird.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('bird')
    .setDescription('Displays a random bird.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('http://shibe.online/api/birds')
      const image = ((await res.json()) as string[])[0]

      const embed = new EmbedBuilder()
        .setTitle('🐦  Chirp!  🐦')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(image)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/animals/cat.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('cat')
    .setDescription('Displays a random cat.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const api = 'https://cataas.com/cat'
      const res = await fetch(`${api}?json=true`)
      const id = ((await res.json()) as { _id: string })._id
      const image = api + '/' + id

      const embed = new EmbedBuilder()
        .setTitle('🐱  Meow!  🐱')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(image)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/animals/catfact.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('catfact')
    .setDescription('Gets a random cat fact.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('https://catfact.ninja/fact')
      const { fact } = (await res.json()) as { fact: string }

      const embed = new EmbedBuilder()
        .setTitle('🐱  Cat Fact  🐱')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setDescription(fact)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/animals/dog.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('dog')
    .setDescription('Displays a random dog.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('https://dog.ceo/api/breeds/image/random')
      const image = ((await res.json()) as { message: string }).message

      const embed = new EmbedBuilder()
        .setTitle('🐶  Woof!  🐶')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(image)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/animals/dogfact.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('dogfact')
    .setDescription('Gets a random dog fact.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('https://dog-api.kinduff.com/api/facts')
      const fact = ((await res.json()) as { facts: string[] }).facts[0]

      const embed = new EmbedBuilder()
        .setTitle('🐶  Dog Fact  🐶')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setDescription(fact)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/animals/duck.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('duck')
    .setDescription('Displays a random duck.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('https://random-d.uk/api/v2/random')
      const image = ((await res.json()) as { url: string }).url

      const embed = new EmbedBuilder()
        .setTitle('🦆  Quack!  🦆')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(image)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/animals/fox.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('fox')
    .setDescription('Displays a random fox.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('https://randomfox.ca/floof/')
      const { image } = (await res.json()) as { image: string }

      const embed = new EmbedBuilder()
        .setTitle('🦊  What does the fox say?  🦊')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(image)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/animals/shibe.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('shibe')
    .setDescription('Displays a random Shiba Inu.'),
  type: CommandType.Animals,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('http://shibe.online/api/shibes')
      const image = ((await res.json()) as string[0])[0]

      const embed = new EmbedBuilder()
        .setTitle('🐶  Woof!  🐶')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(image)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/color/color.ts
================================================
import {
  EmbedBuilder,
  PermissionFlagsBits,
  SlashCommandBuilder,
} from 'discord.js'
import { Command, PaginatedEmbed } from '@structures'
import { Color, CommandType } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('color')
    .setDescription('Displays a list of colors to choose between.')
    .setDMPermission(false),
  type: CommandType.Color,
  permissions: [
    PermissionFlagsBits.ViewChannel,
    PermissionFlagsBits.SendMessages,
    PermissionFlagsBits.ManageRoles,
  ],
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { guild, member } = interaction

    // Get colors
    const { colorRolePrefix } = (await client.configs.fetch(guild.id)) ?? {}
    if (!colorRolePrefix) return
    const colors = guild.roles.cache
      .filter((role) => role.name.startsWith(colorRolePrefix))
      .sort((a, b) => b.position - a.position)
      .map((c) => c)

    const embed = new EmbedBuilder()
      .setThumbnail(guild.iconURL())
      .setColor(guild.members.me?.displayHexColor ?? Color.Default)
      .setFooter({
        text: member.displayName,
        iconURL: member.displayAvatarURL(),
      })
      .setTimestamp()

    const interval = 25
    const pages = []

    for (let i = 0; i < colors.length; i += interval) {
      const max = Math.min(i + interval, colors.length)
      pages.push(
        EmbedBuilder.from(embed)
          .setTitle(`Available Colors [${i + 1} - ${max}/${colors.length}]`)
          .setDescription(colors.slice(i, max).join(' ')),
      )
    }

    await new PaginatedEmbed({
      client,
      interaction,
      pages,
    }).run()
  },
})


================================================
FILE: src/commands/color/randomcolor.ts
================================================
import {
  EmbedBuilder,
  PermissionFlagsBits,
  SlashCommandBuilder,
} from 'discord.js'
import { Command } from '@structures'
import { CommandType, ErrorType } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('randomcolor')
    .setDescription('Changes your current color to a randomly selected one.')
    .setDMPermission(false),
  type: CommandType.Color,
  permissions: [
    PermissionFlagsBits.ViewChannel,
    PermissionFlagsBits.SendMessages,
    PermissionFlagsBits.ManageRoles,
  ],
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { guild, member } = interaction

    // Get colors
    const { colorRolePrefix } = (await client.configs.fetch(guild.id)) ?? {}
    if (!colorRolePrefix) return
    const colors = guild.roles.cache.filter((role) =>
      role.name.startsWith(colorRolePrefix),
    )
    const randomColor = colors.random()
    const oldColor = member.roles.color ?? '`None`'
    if (colors.size === 0 || !randomColor) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, there are no colors set on this server.`,
      )
      return
    }

    // Assign random color
    try {
      await member.roles.remove(colors)
      await member.roles.add(randomColor)
      await client.reply(interaction, {
        embeds: [
          new EmbedBuilder()
            .setTitle('Color Change')
            .setThumbnail(member.displayAvatarURL())
            .setColor(randomColor.hexColor)
            .setFields([
              { name: 'Member', value: `${member}`, inline: true },
              {
                name: 'Color',
                value: `${oldColor} ➔ ${randomColor}`,
                inline: true,
              },
            ])
            .setFooter({
              text: member.displayName,
              iconURL: member.displayAvatarURL(),
            })
            .setTimestamp(),
        ],
      })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/fun/coinflip.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('coinflip')
    .setDescription('Flips a coin.'),
  type: CommandType.Fun,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    const embed = new EmbedBuilder()
      .setTitle('🪙  Coinflip  🪙')
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        `I flipped a coin for you, ${member}! It was **${
          Math.round(Math.random()) ? 'heads' : 'tails'
        }**.`,
      )
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/fun/meme.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('meme')
    .setDescription(
      'Displays a random meme from the "memes", "dankmemes", or "me_irl" subreddits.',
    ),
  type: CommandType.Fun,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('https://meme-api.herokuapp.com/gimme')
      const { title, url } = (await res.json()) as {
        title: string
        url: string
      }

      const embed = new EmbedBuilder()
        .setTitle(title)
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(url)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/fun/thouart.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('thouart')
    .setDescription('Insults a user in an Elizabethan way.')
    .addUserOption((option) =>
      option
        .setName('user')
        .setDescription('The user to insult.')
        .setRequired(false),
    ),
  type: CommandType.Fun,
  run: async (client, interaction): Promise<void> => {
    const { guild } = interaction
    const { targetMember, member, targetUser, user } =
      Command.getMemberAndUser(interaction)

    try {
      const res = await fetch('http://quandyfactory.com/insult/json/')
      let { insult } = (await res.json()) as { insult: string }
      insult = insult.charAt(0).toLowerCase() + insult.slice(1)

      const embed = new EmbedBuilder()
        .setTitle('🎭  Thou Art  🎭')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setDescription(`${targetMember ?? targetUser}, ${insult}`)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/fun/wholesomememe.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('wholesomememe')
    .setDescription(
      'Displays a random meme from the "wholesomememes" subreddit.',
    ),
  type: CommandType.Fun,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch(
        'https://meme-api.herokuapp.com/gimme/wholesomememes',
      )
      const { title, url } = (await res.json()) as {
        title: string
        url: string
      }

      const embed = new EmbedBuilder()
        .setTitle(title)
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(url)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/fun/yesno.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'
import capitalize from 'lodash/capitalize'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('yesno')
    .setDescription('Displays a gif of a yes, a no, or a maybe.'),
  type: CommandType.Fun,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    try {
      const res = await fetch('http://yesno.wtf/api/')
      const json = (await res.json()) as {
        answer: string
        image: string
      }
      const answer = capitalize(json.answer)
      const { image } = json

      let title: string
      if (answer === 'Yes') title = '👍  ' + answer + '!  👍'
      else if (answer === 'No') title = '👎  ' + answer + '!  👎'
      else title = '👍  ' + answer + '?  👎'

      const embed = new EmbedBuilder()
        .setTitle(title)
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setImage(image)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/fun/yomama.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType } from 'enums'
import fetch from 'node-fetch'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('yomama')
    .setDescription("Insults a user's mother.")
    .addUserOption((option) =>
      option
        .setName('user')
        .setDescription('The user to insult the mother of.')
        .setRequired(false),
    ),
  type: CommandType.Fun,
  run: async (client, interaction): Promise<void> => {
    const { guild } = interaction
    const { targetMember, member, targetUser, user } =
      Command.getMemberAndUser(interaction)

    try {
      const res = await fetch('https://api.yomomma.info')
      let { joke } = (await res.json()) as { joke: string }
      joke = joke.charAt(0).toLowerCase() + joke.slice(1)
      if (!joke.endsWith('!') && !joke.endsWith('.') && !joke.endsWith('"'))
        joke += '!' // Cleanup joke

      const embed = new EmbedBuilder()
        .setTitle('👩  Yo Mama  👩')
        .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
        .setDescription(`${targetMember ?? targetUser}, ${joke}`)
        .setFooter({
          text: member?.displayName ?? user.username,
          iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
        })
        .setTimestamp()

      await client.reply(interaction, { embeds: [embed] })
    } catch (err) {
      await client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        `Sorry ${member}, please try again later.`,
      )
    }
  },
})


================================================
FILE: src/commands/information/avatar.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { CommandType } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('avatar')
    .setDescription("Displays a user's avatar.")
    .addUserOption((option) =>
      option
        .setName('user')
        .setDescription('The user to get the avatar of.')
        .setRequired(false),
    ),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { targetMember, member, targetUser, user } =
      Command.getMemberAndUser(interaction)

    const embed = new EmbedBuilder()
      .setTitle(`${targetMember?.displayName ?? targetUser.username}'s Avatar`)
      .setColor(
        targetMember?.displayHexColor ??
          (await targetUser.fetch(true)).hexAccentColor ??
          null,
      )
      .setImage(
        targetMember?.displayAvatarURL({ size: 512 }) ??
          targetUser.displayAvatarURL({ size: 512 }),
      )
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/botinfo.ts
================================================
import { oneLine, stripIndents } from 'common-tags'
import {
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle,
  EmbedBuilder,
  SlashCommandBuilder,
  type User,
} from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Emoji, Image, Url } from 'enums'
import { dependencies, version } from '../../../package.json'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('botinfo')
    .setDescription('Displays bot information.'),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const {
      users,
      user: { id },
      ownerIds,
    } = client
    const { member } = Command.getMember(interaction)

    const botOwners: User[] = []
    for (const id of ownerIds) {
      botOwners.push(users.cache.get(id) ?? (await users.fetch(id)))
    }

    const embed = new EmbedBuilder()
      .setTitle(
        `${
          guild?.members.me?.displayName ?? client.user.username
        }'s Information`,
      )
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        oneLine`
          Calypso is an open source, fully customizable Discord bot that is constantly growing.
          She comes packaged with a variety of commands and a multitude of settings that can be tailored to your server's specific needs. 
          Her codebase also serves as a base framework to easily create Discord bots of all kinds.
          She first went live on **February 22nd, 2018**.
        `,
      )
      .setFields([
        { name: 'Client ID', value: `\`${id}\``, inline: true },
        {
          name: `Developers ${Emoji.Owner}`,
          value: botOwners.join('\n'),
          inline: true,
        },
        {
          name: 'Tech',
          value: stripIndents`\`\`\`asciidoc
            Version     :: ${version}
            Library     :: Discord.js v${
              dependencies['discord.js'].substring(1) || ''
            }
            Environment :: Node.js ${process.version}
            Database    :: MongoDB
          \`\`\``,
        },
      ])
      .setImage(Image.CalypsoTitle)
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    const row = new ActionRowBuilder<ButtonBuilder>().setComponents(
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Invite)
        .setLabel('Invite Me'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.SupportServer)
        .setLabel('Server'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.GithubRepository)
        .setLabel('GitHub'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Donate)
        .setLabel('Donate'),
    )

    await client.reply(interaction, { embeds: [embed], components: [row] })
  },
})


================================================
FILE: src/commands/information/botstats.ts
================================================
import { stripIndent } from 'common-tags'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { CommandType } from 'enums'
import os from 'os'

// eslint-disable-next-line import/no-named-as-default-member
dayjs.extend(duration)

export default new Command({
  data: new SlashCommandBuilder()
    .setName('botstats')
    .setDescription('Displays bot statistics.'),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)
    const { guilds, channels, ws, uptime, commands } = client

    // Get bot uptime
    const d = dayjs.duration(uptime)
    const days = `${d.days()} day${d.days() == 1 ? '' : 's'}`
    const hours = `${d.hours()} hour${d.hours() == 1 ? '' : 's'}`

    // Build stats
    const clientStats = stripIndent`
      Servers   :: ${guilds.cache.size}
      Users     :: ${guilds.cache.reduce(
        (acc, guild) => acc + guild.memberCount,
        0,
      )}
      Channels  :: ${channels.cache.size}
      WS Ping   :: ${Math.round(ws.ping)}ms
      Uptime    :: ${days} and ${hours}
    `
    const serverStats = stripIndent`
      Platform  :: ${os.platform()}
      OS        :: ${os.release()}
      Arch      :: ${os.arch()}
      Hostname  :: ${os.hostname()}
      CPUs      :: ${[...new Set(os.cpus().map((x) => x.model))].join(',')}
      Cores     :: ${os.cpus().length.toString()}
      RAM Total :: ${(os.totalmem() / 1024 / 1024).toFixed(2)} MB
      RAM Free  :: ${(os.freemem() / 1024 / 1024).toFixed(2)} MB
      RAM Usage :: ${((1 - os.freemem() / os.totalmem()) * 100).toFixed(2)}%
      Uptime    :: ${dayjs.duration(os.uptime()).days()} day(s)
    `

    const embed = new EmbedBuilder()
      .setTitle(
        `${
          guild?.members.me?.displayName ?? client.user.username
        }'s Statistics`,
      )
      .setColor(
        guild?.members.me?.displayHexColor ??
          (await client.user.fetch(true)).hexAccentColor ??
          null,
      )
      .addFields([
        {
          name: 'Commands',
          value: `\`${commands.size}\` commands`,
          inline: true,
        },
        {
          name: 'Command Types',
          value: `\`${Object.keys(CommandType).length}\` command types`,
          inline: true,
        },
        {
          name: 'Bot Stats',
          value: `\`\`\`asciidoc\n${clientStats}\`\`\``,
        },
        { name: 'Host Stats', value: `\`\`\`asciidoc\n${serverStats}\`\`\`` },
      ])
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/channelinfo.ts
================================================
import dayjs from 'dayjs'
import { Collection, EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType } from 'enums'

const channelTypes = {
  0: 'Text',
  2: 'Voice',
  4: 'Category',
  5: 'Announcement',
  10: 'Announcement Thread',
  11: 'Public Thread',
  12: 'Private Thread',
  13: 'Stage Voice',
  15: 'Forum',
}

export default new Command({
  data: new SlashCommandBuilder()
    .setName('channelinfo')
    .setDescription('Displays channel information.')
    .addChannelOption((option) =>
      option
        .setName('channel')
        .setDescription('The channel to display the information of.')
        .setRequired(false),
    )
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { guild, member, options } = interaction

    await guild.members.fetch() // Fetch before snagging channel

    const channel = options.getChannel('channel') ?? interaction.channel
    if (!channel) return

    const { id, type, createdAt, members } = channel
    let memberCount: number
    let botCount: number

    if (members instanceof Collection) {
      memberCount = members.size
      botCount = members.filter((member) => member.user.bot).size
    } else {
      memberCount = members.cache.size
      botCount = members.cache.filter((member) => member.user?.bot).size
    }

    const embed = new EmbedBuilder()
      .setTitle('Channel Information')
      .setThumbnail(guild.iconURL())
      .setColor(guild.members.me?.displayHexColor ?? Color.Default)
      .setFields([
        { name: 'Channel', value: `${channel}`, inline: true },
        {
          name: 'ID',
          value: `\`${id}\``,
          inline: true,
        },
        {
          name: 'Type',
          value: `\`${channelTypes[type]}\``,
          inline: true,
        },
        {
          name: 'Members',
          value: `\`${memberCount}\``,
          inline: true,
        },
        {
          name: 'Bots',
          value: `\`${botCount}\``,
          inline: true,
        },
        {
          name: 'Created On',
          value: `\`${dayjs(createdAt).format('MMM DD YYYY')}\``,
          inline: true,
        },
      ])
      .setFooter({
        text: member.displayName,
        iconURL: member.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/donate.ts
================================================
import {
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle,
  EmbedBuilder,
  SlashCommandBuilder,
} from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Image, Url } from 'enums'
import { stripIndents } from 'common-tags'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('donate')
    .setDescription("Provides a link to the bot's donation page."),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    const embed = new EmbedBuilder()
      .setTitle('Donate')
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        stripIndents`
          Click [here](${Url.Donate}) to donate!
          Thank you for helping to keep me running!
        `,
      )
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    const row = new ActionRowBuilder<ButtonBuilder>().setComponents(
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Invite)
        .setLabel('Invite Me'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.SupportServer)
        .setLabel('Server'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.GithubRepository)
        .setLabel('GitHub'),
    )

    await client.reply(interaction, { embeds: [embed], components: [row] })
  },
})


================================================
FILE: src/commands/information/findid.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('findid')
    .setDescription('Finds the ID of the given user or role.')
    .addMentionableOption((option) =>
      option
        .setName('target')
        .setDescription('The target to find the ID of.')
        .setRequired(true),
    )
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { user, guild, member, options } = interaction
    const target = options.getMentionable('target')
    if (!target) return

    const embed = new EmbedBuilder()
      .setTitle('Find ID')
      .setColor(guild.members.me?.displayHexColor ?? Color.Default)
      .setFields([
        { name: 'Target', value: `${target}`, inline: true },
        {
          name: 'ID',
          value: `\`${target.id}\``,
          inline: true,
        },
      ])
      .setFooter({
        text: member.displayName || user.username,
        iconURL: member.displayAvatarURL() || user.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/github.ts
================================================
import { stripIndents } from 'common-tags'
import {
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle,
  EmbedBuilder,
  SlashCommandBuilder,
} from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Image, Url } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('github')
    .setDescription("Provides a link to the bot's GitHub repository."),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    const embed = new EmbedBuilder()
      .setTitle('GitHub Repository')
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        stripIndents`
          Click [here](${Url.GithubRepository}) to visit my GitHub repository!
          Please support me by starring ⭐ my repo!
        `,
      )
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    const row = new ActionRowBuilder<ButtonBuilder>().setComponents(
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Invite)
        .setLabel('Invite Me'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.SupportServer)
        .setLabel('Server'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Donate)
        .setLabel('Donate'),
    )

    await client.reply(interaction, { embeds: [embed], components: [row] })
  },
})


================================================
FILE: src/commands/information/help.ts
================================================
import { oneLine } from 'common-tags'
import {
  type APIApplicationCommandOptionChoice,
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle,
  EmbedBuilder,
  SelectMenuBuilder,
  SlashCommandBuilder,
} from 'discord.js'
import capitalize from 'lodash/capitalize'
import { Command } from '@structures'
import { Color, CommandType, Image, Url } from 'enums'

export const descriptions = {
  [CommandType.Information]: 'Commands that provide various information.',
  [CommandType.Fun]: 'Commands for fun and games.',
  [CommandType.Animals]:
    'Commands that display animal pictures or get animal facts.',
  [CommandType.Color]: 'Commands for manipulating your Discord color.',
  [CommandType.Miscellaneous]: 'Commands that do not belong to any other type.',
}

const categories: APIApplicationCommandOptionChoice<string>[] = Object.entries(
  CommandType,
).map(([key, value]) => ({ name: key, value }))

export default new Command({
  data: new SlashCommandBuilder()
    .setName('help')
    .setDescription(
      oneLine`
        Lists all available commands, sorted by type.
        Provide a type for additional information.
      `,
    )
    .addStringOption((option) =>
      option
        .setName('type')
        .setDescription('The type to list the commands of.')
        .setChoices(...categories)
        .setRequired(false),
    ),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild, options } = interaction
    const { member } = Command.getMember(interaction)

    const embed = new EmbedBuilder()
      .setTitle(
        `${guild?.members.me?.displayName ?? client.user.username}'s Commands`,
      )
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setImage(Image.CalypsoTitle)
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    const type = options.getString('type')
    if (type) {
      const commands = client.commands.filter((command) => command.type == type)
      embed.setFields({
        name: `**${capitalize(type)} [${commands.size}]**`,
        value: commands
          .map(
            (command) =>
              `\`${command.data.name}\` **-** ${command.data.description}`,
          )
          .join('\n'),
      })
    } else {
      // Get all commands
      const commands: { [key in CommandType]: string[] } = {
        [CommandType.Information]: [],
        [CommandType.Fun]: [],
        [CommandType.Animals]: [],
        [CommandType.Color]: [],
        [CommandType.Miscellaneous]: [],
      }

      client.commands.forEach((command) => {
        commands[command.type].push(`\`${command.data.name}\``)
      })

      for (const [key, value] of Object.entries(commands)) {
        embed.addFields([
          {
            name: `**${capitalize(key)} [${value.length}]**`,
            value: value.join(' '),
          },
        ])
      }
    }

    const rows = [
      new ActionRowBuilder<SelectMenuBuilder>().setComponents(
        new SelectMenuBuilder().setCustomId('help').setOptions(
          Object.entries(CommandType).map(([key, value]) => ({
            label: key,
            value,
            description: descriptions[value],
            default: value === type,
          })),
        ),
      ),
      new ActionRowBuilder<ButtonBuilder>().setComponents(
        new ButtonBuilder()
          .setStyle(ButtonStyle.Link)
          .setURL(Url.Invite)
          .setLabel('Invite Me'),
        new ButtonBuilder()
          .setStyle(ButtonStyle.Link)
          .setURL(Url.SupportServer)
          .setLabel('Server'),
        new ButtonBuilder()
          .setStyle(ButtonStyle.Link)
          .setURL(Url.GithubRepository)
          .setLabel('GitHub'),
        new ButtonBuilder()
          .setStyle(ButtonStyle.Link)
          .setURL(Url.Donate)
          .setLabel('Donate'),
      ),
    ]

    await client.reply(interaction, {
      embeds: [embed],
      components: [...rows],
      ephemeral: true,
    })
  },
})


================================================
FILE: src/commands/information/inviteme.ts
================================================
import {
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle,
  EmbedBuilder,
  SlashCommandBuilder,
} from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Image, Url } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('inviteme')
    .setDescription('Provides a link to invite the bot.'),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    const embed = new EmbedBuilder()
      .setTitle('Invite Me!')
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(`Click [here](${Url.Invite}) to invite me!`)
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    const row = new ActionRowBuilder<ButtonBuilder>().setComponents(
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.SupportServer)
        .setLabel('Server'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.GithubRepository)
        .setLabel('GitHub'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Donate)
        .setLabel('Donate'),
    )

    await client.reply(interaction, { embeds: [embed], components: [row] })
  },
})


================================================
FILE: src/commands/information/memberstatus.ts
================================================
import { stripIndents } from 'common-tags'
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Emoji } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('memberstatus')
    .setDescription(
      'Gets how many server members are online, busy, AFK, and offline.',
    )
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { user, guild, member } = interaction
    const { members } = guild

    await members.fetch()

    // Count members by status
    const online = members.cache.filter(
      (member) => member.presence?.status === 'online',
    ).size
    const offline = members.cache.filter(
      (member) =>
        member.presence?.status === 'offline' ||
        member.presence?.status === undefined,
    ).size
    const dnd = members.cache.filter(
      (member) => member.presence?.status === 'dnd',
    ).size
    const afk = members.cache.filter(
      (member) => member.presence?.status === 'idle',
    ).size

    const embed = new EmbedBuilder()
      .setTitle(`Member Status [${members.cache.size}]`)
      .setThumbnail(guild.iconURL())
      .setColor(guild.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        stripIndents`
        ${Emoji.Online} **Online:** \`${online}\` members
        ${Emoji.Dnd} **Busy:** \`${dnd}\` members
        ${Emoji.Idle} **AFK:** \`${afk}\` members
        ${Emoji.Offline} **Offline:** \`${offline}\` members
      `,
      )
      .setFooter({
        text: member.displayName || user.username,
        iconURL: member.displayAvatarURL() || user.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/permissions.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { CommandType } from 'enums'
import { getPermissions } from 'utils'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('permissions')
    .setDescription("Displays a user's permissions.")
    .addUserOption((option) =>
      option
        .setName('user')
        .setDescription('The user to get the permissions of.')
        .setRequired(false),
    )
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { targetMember, member } = Command.getMember(interaction)
    if (!targetMember || !member) return

    const permissions = getPermissions(targetMember)

    const embed = new EmbedBuilder()
      .setTitle(`${targetMember.displayName}'s Permissions`)
      .setThumbnail(targetMember.displayAvatarURL())
      .setColor(targetMember.displayHexColor)
      .setDescription(`\`\`\`diff\n${permissions.join('\n')}\`\`\``)
      .setFooter({
        text: member.displayName,
        iconURL: member.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/ping.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Emoji } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('ping')
    .setDescription("Gets the bot's current ping."),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild, createdTimestamp } = interaction
    const { member } = Command.getMember(interaction)

    const embed = new EmbedBuilder()
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription('`Pinging...`')

    const message = await client.reply(interaction, {
      embeds: [embed],
      fetchReply: true,
    })

    const heartbeat = `\`\`\`ini\n[ ${Math.round(client.ws.ping)}ms ]\`\`\``
    const latency = `\`\`\`ini\n[ ${Math.floor(
      message.createdTimestamp - createdTimestamp,
    )}ms ]\`\`\``

    embed
      .setTitle(`Pong  ${Emoji.Pong}`)
      .setDescription(null)
      .addFields(
        { name: 'Heartbeat', value: heartbeat, inline: true },
        { name: 'API Latency', value: latency, inline: true },
      )
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    await client.editReply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/roleinfo.ts
================================================
import dayjs from 'dayjs'
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { CommandType } from 'enums'
import { getPermissions } from 'utils'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('roleinfo')
    .setDescription('Displays role information.')
    .addRoleOption((option) =>
      option
        .setName('role')
        .setDescription('The role to display the information of.')
        .setRequired(true),
    )
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { guild, member, options } = interaction

    await guild.members.fetch() // Fetch before snagging role

    const role = options.getRole('role')
    if (!role) return

    const {
      id,
      position,
      mentionable,
      managed,
      hoist,
      hexColor,
      members,
      createdAt,
    } = role

    const permissions = getPermissions(role)

    const revPosition = `\`${guild.roles.cache.size - position}\`**/**\`${
      guild.roles.cache.size
    }\``

    const embed = new EmbedBuilder()
      .setTitle('Role Information')
      .setThumbnail(guild.iconURL())
      .setColor(hexColor)
      .setFields([
        { name: 'Role', value: `${role}`, inline: true },
        {
          name: 'ID',
          value: `\`${id}\``,
          inline: true,
        },
        {
          name: 'Position',
          value: `${revPosition}`,
          inline: true,
        },
        {
          name: 'Mentionable',
          value: `\`${mentionable}\``,
          inline: true,
        },
        {
          name: 'Bot Role',
          value: `\`${managed}\``,
          inline: true,
        },
        {
          name: 'Hoisted',
          value: `\`${hoist}\``,
          inline: true,
        },
        {
          name: 'Color',
          value: `\`${hexColor.toUpperCase()}\``,
          inline: true,
        },
        {
          name: 'Members',
          value: `\`${members.size}\``,
          inline: true,
        },
        {
          name: 'Created On',
          value: `\`${dayjs(createdAt).format('MMM DD YYYY')}\``,
          inline: true,
        },
        {
          name: 'Permissions',
          value: `\`\`\`diff\n${permissions.join('\n')}\`\`\``,
          inline: true,
        },
      ])
      .setFooter({
        text: member.displayName,
        iconURL: member.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/servericon.ts
================================================
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('servericon')
    .setDescription("Displays the server's icon.")
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { guild, member } = interaction
    const embed = new EmbedBuilder()
      .setTitle(`${guild.name}'s Icon`)
      .setColor(guild.members.me?.displayHexColor ?? Color.Default)
      .setImage(guild.iconURL({ size: 512 }))
      .setFooter({
        text: member.displayName,
        iconURL: member.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/serverinfo.ts
================================================
import { stripIndent } from 'common-tags'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
import { ChannelType, EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Emoji } from 'enums'

// eslint-disable-next-line import/no-named-as-default-member
dayjs.extend(duration)

const verificationLevels = [
  '`None`',
  '`Low`',
  '`Medium`',
  '`High`',
  '`Highest`',
]
const notifications = ['`All`', '`Mentions`']
const premiumTiers = ['`None`', '`Tier 1`', '`Tier 2`', '`Tier 3`']

export default new Command({
  data: new SlashCommandBuilder()
    .setName('serverinfo')
    .setDescription('Displays server information and statistics.')
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { user, guild, member } = interaction
    const { id, channels, roles, members, emojis, createdAt } = guild

    // Get member stats
    await members.fetch()
    const memberCount = members.cache.size
    const botCount = members.cache.filter((member) => member.user.bot).size
    const online = members.cache.filter(
      (member) => member.presence?.status === 'online',
    ).size
    const offline = members.cache.filter(
      (member) =>
        member.presence?.status === 'offline' ||
        member.presence?.status === undefined,
    ).size
    const dnd = members.cache.filter(
      (member) => member.presence?.status === 'dnd',
    ).size
    const afk = members.cache.filter(
      (member) => member.presence?.status === 'idle',
    ).size

    // Get channel stats
    const channelCount = channels.cache.size
    const textChannels = channels.cache.filter(
      (channel) => channel.type === ChannelType.GuildText && channel.viewable,
    ).size
    const forumChannels = channels.cache.filter(
      (channel) => channel.type === ChannelType.GuildForum && channel.viewable,
    ).size
    const voiceChannels = channels.cache.filter(
      (channel) =>
        channel.type === ChannelType.GuildVoice ||
        channel.type === ChannelType.GuildStageVoice,
    ).size
    const newsChannels = channels.cache.filter(
      (channel) => channel.type === ChannelType.GuildAnnouncement,
    ).size
    const categoryChannels = channels.cache.filter(
      (channel) => channel.type === ChannelType.GuildCategory,
    ).size

    // Get role stats
    const roleCount = roles.cache.size - 1 // Don't count @everyone

    // Get emoji stats
    const emojiCount = emojis.cache.size

    const serverStats = stripIndent`
      Members  :: [ ${memberCount} ]
               :: ${online} Online
               :: ${dnd} Busy
               :: ${afk} AFK
               :: ${offline} Offline
               :: ${botCount} Bots
      Channels :: [ ${channelCount} ]
               :: ${textChannels} Text
               :: ${forumChannels} Forum
               :: ${voiceChannels} Voice
               :: ${newsChannels} Announcement
               :: ${categoryChannels} Category
      Roles    :: [ ${roleCount} ]
      Emojis   :: [ ${emojiCount} ]
    `

    const embed = new EmbedBuilder()
      .setTitle(`${guild.name}'s Information`)
      .setThumbnail(guild.iconURL())
      .setColor(guild.members.me?.displayHexColor ?? Color.Default)
      .setFields([
        {
          name: 'ID',
          value: `\`${id}\``,
          inline: true,
        },
        {
          name: `Owner ${Emoji.Owner}`,
          value: `${members.cache.get(guild.ownerId)}`,
          inline: true,
        },
        {
          name: 'Verification Level',
          value: verificationLevels[guild.verificationLevel],
          inline: true,
        },
        {
          name: 'Rules Channel',
          value: guild.rulesChannel ? `${guild.rulesChannel}` : '`None`',
          inline: true,
        },
        {
          name: 'System Channel',
          value: guild.systemChannel ? `${guild.systemChannel}` : '`None`',
          inline: true,
        },
        {
          name: 'AFK Channel',
          value: guild.afkChannel
            ? `${Emoji.Voice} ${guild.afkChannel.name}`
            : '`None`',
          inline: true,
        },
        {
          name: 'AFK Timeout',
          value: guild.afkChannel
            ? `\`${dayjs
                .duration(guild.afkTimeout * 1000)
                .asMinutes()} minutes\``
            : '`None`',
          inline: true,
        },
        {
          name: 'Default Notifications',
          value: notifications[guild.defaultMessageNotifications],
          inline: true,
        },
        {
          name: 'Partnered',
          value: `\`${guild.partnered}\``,
          inline: true,
        },
        {
          name: 'Premium Tier',
          value: premiumTiers[guild.premiumTier],
          inline: true,
        },
        {
          name: 'Verified',
          value: `\`${guild.verified}\``,
          inline: true,
        },
        {
          name: 'Created On',
          value: `\`${dayjs(createdAt).format('MMM DD YYYY')}\``,
          inline: true,
        },
        {
          name: 'Server Stats',
          value: `\`\`\`asciidoc\n${serverStats}\`\`\``,
        },
      ])
      .setFooter({
        text: member.displayName || user.username,
        iconURL: member.displayAvatarURL() || user.displayAvatarURL(),
      })
      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/supportserver.ts
================================================
import {
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle,
  EmbedBuilder,
  SlashCommandBuilder,
} from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Image, Url } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('supportserver')
    .setDescription("Provides a link to the bot's support server."),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    const embed = new EmbedBuilder()
      .setTitle('Support Server')
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        `Click [here](${Url.SupportServer}) to join my support server!`,
      )
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })
      .setTimestamp()

    const row = new ActionRowBuilder<ButtonBuilder>().setComponents(
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Invite)
        .setLabel('Invite Me'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.GithubRepository)
        .setLabel('GitHub'),
      new ButtonBuilder()
        .setStyle(ButtonStyle.Link)
        .setURL(Url.Donate)
        .setLabel('Donate'),
    )

    await client.reply(interaction, { embeds: [embed], components: [row] })
  },
})


================================================
FILE: src/commands/information/uptime.ts
================================================
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
import advancedFormat from 'dayjs/plugin/advancedFormat'
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, Image } from 'enums'

/* eslint-disable import/no-named-as-default-member */
dayjs.extend(duration)
dayjs.extend(advancedFormat)
/* eslint-enable import/no-named-as-default-member */

export default new Command({
  data: new SlashCommandBuilder()
    .setName('uptime')
    .setDescription("Gets the bot's current uptime."),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    const { user, guild } = interaction
    const { member } = Command.getMember(interaction)

    const d = dayjs.duration(client.uptime)
    const days = `${d.days()} day${d.days() == 1 ? '' : 's'}`
    const hours = `${d.hours()} hour${d.hours() == 1 ? '' : 's'}`
    const minutes = `${d.minutes()} minute${d.minutes() == 1 ? '' : 's'}`
    const seconds = `${d.seconds()} second${d.seconds() == 1 ? '' : 's'}`
    const date = dayjs().subtract(d.days(), 'day').format('dddd, MMMM Do YYYY')

    const embed = new EmbedBuilder()
      .setTitle(
        `${guild?.members.me?.displayName ?? client.user.username}'s Uptime`,
      )
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        `\`\`\`prolog\n${days}, ${hours}, ${minutes}, and ${seconds}\`\`\``,
      )
      .setFields({ name: 'Date Launched', value: date, inline: true })
      .setFooter({
        text: member?.displayName ?? user.username,
        iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
      })

      .setTimestamp()

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/information/userinfo.ts
================================================
import dayjs from 'dayjs'
import type { UserFlagsString } from 'discord.js'
import { ActivityType, EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { CommandType, Emoji } from 'enums'

const statuses = {
  online: `${Emoji.Online} \`Online\``,
  idle: `${Emoji.Idle} \`AFK\``,
  offline: `${Emoji.Offline} \`Offline\``,
  invisible: `${Emoji.Offline} \`Offline\``,
  dnd: `${Emoji.Dnd} \`Do Not Disturb\``,
}

const badges: Record<UserFlagsString, string> = {
  Staff: `${Emoji.DiscordEmployee} \`Discord Employee\``,
  Partner: `${Emoji.DiscordPartner} \`Partnered Server Owner\``,
  BugHunterLevel1: `${Emoji.BugHunterLevel1} \`Bug Hunter (Level 1)\``,
  BugHunterLevel2: `${Emoji.BugHunterLevel2} \`Bug Hunter (Level 2)\``,
  Hypesquad: `${Emoji.HypeSquadEvents} \`HypeSquad Events\``,
  HypeSquadOnlineHouse1: `${Emoji.HouseBravery} \`House of Bravery\``,
  HypeSquadOnlineHouse2: `${Emoji.HouseBrilliance} \`House of Brilliance\``,
  HypeSquadOnlineHouse3: `${Emoji.HouseBalance} \`House of Balance\``,
  PremiumEarlySupporter: `${Emoji.EarlySupporter} \`Early Supporter\``,
  TeamPseudoUser: 'Team User',
  VerifiedBot: `${Emoji.VerifiedBot} \`Verified Bot\``,
  VerifiedDeveloper: `${Emoji.VerifiedDeveloper} \`Early Verified Bot Developer\``,
  CertifiedModerator: '',
  BotHTTPInteractions: '',
  Spammer: '',
  Quarantined: '',
}

export default new Command({
  data: new SlashCommandBuilder()
    .setName('userinfo')
    .setDescription("Display's a user's information.")
    .addUserOption((option) =>
      option
        .setName('user')
        .setDescription('The user to get the information of.')
        .setRequired(false),
    )
    .setDMPermission(false),
  type: CommandType.Information,
  run: async (client, interaction): Promise<void> => {
    if (!interaction.inCachedGuild()) return
    const { targetMember, member } = Command.getMember(interaction)
    const {
      id,
      user,
      presence,
      roles,
      displayName,
      displayHexColor,
      joinedAt,
    } = targetMember

    const userFlags = (await user.fetchFlags()).toArray()

    // Get activities
    const activities = []
    let customStatus: string | null = null
    if (presence)
      for (const activity of presence.activities.values()) {
        switch (activity.type) {
          case ActivityType.Playing:
            activities.push(`Playing **${activity.name}**`)
            break
          case ActivityType.Listening:
            if (user.bot) activities.push(`Listening to **${activity.name}**`)
            else
              activities.push(
                `Listening to **${activity.details}** by **${activity.state}**`,
              )
            break
          case ActivityType.Watching:
            activities.push(`Watching **${activity.name}**`)
            break
          case ActivityType.Streaming:
            activities.push(`Streaming **${activity.name}**`)
            break
          case ActivityType.Custom:
            customStatus = activity.state
            break
        }
      }

    const embed = new EmbedBuilder()
      .setTitle(`${displayName}'s Information`)
      .setThumbnail(targetMember.displayAvatarURL())
      .setColor(displayHexColor)

      .setFields(
        { name: 'User', value: `${targetMember}`, inline: true },
        {
          name: 'Discriminator',
          value: `\`${user.discriminator}\``,
          inline: true,
        },
        {
          name: 'ID',
          value: `\`${id}\``,
          inline: true,
        },
        {
          name: 'Status',
          value: statuses[presence?.status ?? 'offline'],
          inline: true,
        },
        {
          name: 'Bot',
          value: `\`${user.bot}\``,
          inline: true,
        },
        {
          name: 'Color Role',
          value: `${roles.color ?? '`None`'}`,
          inline: true,
        },
        {
          name: 'Highest Role',
          value: `${roles.highest}`,
          inline: true,
        },
        {
          name: 'Join Server on',
          value: `\`${dayjs(joinedAt).format('MMM DD YYYY')}\``,
          inline: true,
        },
        {
          name: 'Joined Discord On',
          value: `\`${dayjs(user.createdAt).format('MMM DD YYYY')}\``,
          inline: true,
        },
      )
      .setFooter({
        text: member.displayName,
        iconURL: member.displayAvatarURL(),
      })
      .setTimestamp()
    if (activities.length > 0) embed.setDescription(activities.join('\n'))
    if (customStatus)
      embed.spliceFields(0, 0, { name: 'Custom Status', value: customStatus })
    if (userFlags.length > 0)
      embed.addFields([
        {
          name: 'Badges',
          value: userFlags.map((flag) => badges[flag]).join('\n'),
        },
      ])

    await client.reply(interaction, { embeds: [embed] })
  },
})


================================================
FILE: src/commands/miscellaneous/feedback.ts
================================================
import { stripIndents } from 'common-tags'
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType, Image, Url } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('feedback')
    .setDescription(
      "Sends a message to the Calypso Support Server's feedback channel.",
    )
    .addStringOption((option) =>
      option
        .setName('feedback')
        .setDescription('The feedback to send.')
        .setRequired(true),
    ),
  type: CommandType.Miscellaneous,
  run: async (client, interaction): Promise<void> => {
    const { user, guild, options } = interaction
    const { member } = Command.getMember(interaction)

    // Get feedback channel
    const feedbackChannel = client.channels.cache.get(client.feedbackChannelId)
    if (!feedbackChannel || !feedbackChannel.isTextBased())
      return client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        'Unable to fetch feedback channel. Please try again later.',
      )

    const embed = new EmbedBuilder()
      .setTitle('Feedback')
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(options.getString('feedback'))
      .setFields([
        { name: 'User', value: user.tag, inline: true },
        {
          name: 'Server',
          value: interaction.guild?.name ?? '`none`',
          inline: true,
        },
      ])
      .setTimestamp()
    await client.send(feedbackChannel, { embeds: [embed] })

    await client.reply(interaction, {
      embeds: [
        new EmbedBuilder()
          .setTitle('Feedback Sent')
          .setThumbnail(Image.Calypso)
          .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
          .setDescription(
            stripIndents`
              Your feedback was successfully sent!
              Please join the [Calypso Support Server](${Url.SupportServer}) for further discussion.
            `,
          )
          .setFooter({
            text: member?.displayName ?? user.username,
            iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
          })
          .setTimestamp(),
      ],
      ephemeral: true,
    })
  },
})


================================================
FILE: src/commands/miscellaneous/reportbug.ts
================================================
import { stripIndents } from 'common-tags'
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'
import { Command } from '@structures'
import { Color, CommandType, ErrorType, Image, Url } from 'enums'

export default new Command({
  data: new SlashCommandBuilder()
    .setName('reportbug')
    .setDescription(
      "Sends a message to the Calypso Support Server's bug reports channel.",
    )
    .addStringOption((option) =>
      option
        .setName('bugreport')
        .setDescription('The bug to report.')
        .setRequired(true),
    ),
  type: CommandType.Miscellaneous,
  run: async (client, interaction): Promise<void> => {
    const { user, guild, options } = interaction
    const { member } = Command.getMember(interaction)

    // Get bug report channel
    const bugReportChannel = client.channels.cache.get(
      client.bugReportChannelId,
    )
    if (!bugReportChannel || !bugReportChannel.isTextBased())
      return client.replyWithError(
        interaction,
        ErrorType.CommandFailure,
        'Unable to fetch bug report channel. Please try again later.',
      )

    const embed = new EmbedBuilder()
      .setTitle('Bug Report')
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(options.getString('bugreport'))
      .setFields([
        { name: 'User', value: user.tag, inline: true },
        {
          name: 'Server',
          value: interaction.guild?.name ?? '`none`',
          inline: true,
        },
      ])
      .setTimestamp()
    await client.send(bugReportChannel, { embeds: [embed] })

    await client.reply(interaction, {
      embeds: [
        new EmbedBuilder()
          .setTitle('Bug Report Sent')
          .setThumbnail(Image.Calypso)
          .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
          .setDescription(
            stripIndents`
              Your bug report was successfully sent!
              Please join the [Calypso Support Server](${Url.SupportServer}) for further discussion.
            `,
          )
          .setFooter({
            text: member?.displayName ?? user.username,
            iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
          })
          .setTimestamp(),
      ],
      ephemeral: true,
    })
  },
})


================================================
FILE: src/components/selectMenus/help.ts
================================================
import {
  ActionRowBuilder,
  type ButtonBuilder,
  EmbedBuilder,
  SelectMenuBuilder,
  type SelectMenuComponent,
  type SelectMenuInteraction,
} from 'discord.js'
import capitalize from 'lodash/capitalize'
import { CommandType } from 'enums'
import { Component } from '@structures'
import { descriptions } from '@commands/information/help'

export default new Component<SelectMenuInteraction>({
  customId: 'help',
  run: async (client, interaction): Promise<void> => {
    const {
      message: { embeds, components },
    } = interaction

    const type = interaction.values[0]

    const commands = client.commands.filter((command) => command.type == type)

    const embed = EmbedBuilder.from(embeds[0])
      .setTitle(`**${capitalize(type)} [${commands.size}]**`)
      .setFields(
        commands.map((command) => {
          return {
            name: `\`${command.data.name}\``,
            value: command.data.description,
            inline: true,
          }
        }),
      )

    const rows = [
      ActionRowBuilder.from(components[0]).setComponents(
        SelectMenuBuilder.from(
          components[0].components[0] as SelectMenuComponent,
        ).setOptions(
          Object.entries(CommandType).map(([key, value]) => ({
            label: key,
            value,
            description: descriptions[value],
            default: value === type,
          })),
        ),
      ) as ActionRowBuilder<SelectMenuBuilder>,
      ActionRowBuilder.from(components[1]) as ActionRowBuilder<ButtonBuilder>,
    ]

    await client.update(interaction, { embeds: [embed], components: [...rows] })
  },
})


================================================
FILE: src/config.ts
================================================
import { config } from 'dotenv'
import { getEnvironmentVariable } from 'utils'
import yargs from 'yargs/yargs'
import { hideBin } from 'yargs/helpers'

const argv = yargs(hideBin(process.argv))
  .option('debug', {
    alias: 'd',
    type: 'boolean',
    default: false,
    description: 'Run with debug mode',
  })
  .parseSync()

config()

export default {
  token: getEnvironmentVariable('TOKEN'),
  clientId: getEnvironmentVariable('CLIENT_ID'),
  guildId: getEnvironmentVariable('GUILD_ID'),
  ownerIds: getEnvironmentVariable('OWNER_IDS').split(','),
  feedbackChannelId: process.env.FEEDBACK_CHANNEL_ID ?? '',
  bugReportChannelId: process.env.BUG_REPORT_CHANNEL_ID ?? '',
  debug: argv.debug,
}


================================================
FILE: src/enums.ts
================================================
/**
 * Enum representing all possible command types.
 */
export enum CommandType {
  Information = 'information',
  Fun = 'fun',
  Animals = 'animals',
  Color = 'color',
  Miscellaneous = 'miscellaneous',
}

/**
 * List of all possible error types.
 */
export enum ErrorType {
  MissingPermissions = 'Missing Permissions',
  CommandFailure = 'Command Failure',
}

/**
 * Enum representing all possible emojis.
 *
 * @remarks
 * If cloning this project and self-hosting the bot,
 * you MUST replace the IDs of these values with emoji IDs from your own server.
 */
export enum Emoji {
  Pong = '<:pong:747295268201824307>',
  Fail = '<:fail:736449226120233031>',
  Owner = '<:owner:735338114230255616>',
  Voice = '<:voice:735665114870710413>',
  Online = '<:online:735341197450805279>',
  Dnd = '<:dnd:735341494537289768>',
  Idle = '<:idle:735341387842584648>',
  Offline = '<:offline:735341676121554986>',
  DiscordEmployee = '<:DISCORD_EMPLOYEE:735339014621626378>',
  DiscordPartner = '<:DISCORD_PARTNER:735339215746760784>',
  BugHunterLevel1 = '<:BUGHUNTER_LEVEL_1:735339352913346591>',
  BugHunterLevel2 = '<:BUGHUNTER_LEVEL_2:735339420667871293>',
  HypeSquadEvents = '<:HYPESQUAD_EVENTS:735339581087547392>',
  HouseBravery = '<:HOUSE_BRAVERY:735339756283756655>',
  HouseBrilliance = '<:HOUSE_BRILLIANCE:735339675102871642>',
  HouseBalance = '<:HOUSE_BALANCE:735339871018942466>',
  EarlySupporter = '<:EARLY_SUPPORTER:735340061226172589>',
  VerifiedBot = '<:VERIFIED_BOT:735345343037833267>',
  VerifiedDeveloper = '<:VERIFIED_DEVELOPER:735340154310361202>',
}

/**
 * Enum representing all color hexes used throughout the codebase.
 */
export enum Color {
  Default = '#1C5B4B',
  Error = '#FF0000',
}

/**
 * Enum representing all Calypso images used in commands.
 */
export enum Image {
  Calypso = 'https://raw.githubusercontent.com/sabattle/CalypsoBot/main/images/Calypso.png',
  CalypsoTitle = 'https://raw.githubusercontent.com/sabattle/CalypsoBot/main/images/Calypso_Title.png',
}

/**
 * Enum representing all URLs relating to Calypso.
 */
export enum Url {
  Invite = 'https://discord.com/api/oauth2/authorize?client_id=416451977380364288&permissions=1099914374230&scope=applications.commands%20bot',
  SupportServer = 'https://discord.gg/9SpsSG5VWh',
  GithubRepository = 'https://github.com/sabattle/CalypsoBot',
  Donate = 'https://www.paypal.com/paypalme/sebastianabattle',
}


================================================
FILE: src/events/debug.ts
================================================
import { Event } from '@structures'
import { Events } from 'discord.js'
import logger from 'logger'

export default new Event(Events.Debug, (message) => {
  logger.info(message)
})


================================================
FILE: src/events/error.ts
================================================
import { Event } from '@structures'
import { Events } from 'discord.js'
import logger from 'logger'

export default new Event(Events.Error, (err) => {
  logger.error(err)
})


================================================
FILE: src/events/guildCreate.ts
================================================
import prisma from 'prisma'
import { Events } from 'discord.js'
import logger from 'logger'
import { Event } from '@structures'

export default new Event(Events.GuildCreate, async (client, guild) => {
  const { id: guildId, name } = guild

  await prisma.guild.create({
    data: {
      guildId,
      name,
      config: {},
    },
  })

  logger.info(`Calypso has joined ${name}`)
})


================================================
FILE: src/events/interactionCreate.ts
================================================
import {
  type ButtonInteraction,
  type ChatInputCommandInteraction,
  Events,
  PermissionsBitField,
  type SelectMenuInteraction,
} from 'discord.js'
import logger from 'logger'
import { ErrorType } from 'enums'
import startCase from 'lodash/startCase'
import { type Client, type Command, type Component, Event } from '@structures'

/**
 * Utility function to check if the client is missing any necessary permissions.
 *
 * @param client - The instantiated client
 * @param interaction - The interaction that spawned the event
 * @param structure - The structure that is being executed
 * @returns `true` or `false`
 */
const hasPermission = async (
  client: Client<true>,
  interaction:
    | ChatInputCommandInteraction
    | ButtonInteraction
    | SelectMenuInteraction,
  structure:
    | Command
    | Component<ButtonInteraction>
    | Component<SelectMenuInteraction>,
): Promise<boolean> => {
  if (!interaction.inCachedGuild()) return true
  const permissions: string[] =
    interaction.channel
      ?.permissionsFor(client.user)
      ?.missing(structure.permissions)
      .map((p) => startCase(String(new PermissionsBitField(p).toArray()))) ?? []
  if (permissions.length != 0) {
    await client.replyWithError(
      interaction,
      ErrorType.MissingPermissions,
      `Sorry ${
        interaction.member
      }, I need the following permissions:\n \`\`\`diff\n- ${permissions.join(
        '\n- ',
      )}\`\`\``,
    )
    return false
  }
  return true
}

export default new Event(
  Events.InteractionCreate,
  async (client, interaction) => {
    if (!client.isReady()) return

    if (interaction.isChatInputCommand()) {
      const command = client.commands.get(interaction.commandName)

      if (!command || !(await hasPermission(client, interaction, command)))
        return

      // Run command
      try {
        await command.run(client, interaction)
      } catch (err) {
        if (err instanceof Error) logger.error(err.stack)
        else logger.error(err)
      }
    } else if (interaction.isSelectMenu()) {
      const selectMenu = client.selectMenus.get(interaction.customId)

      if (
        !selectMenu ||
        !(await hasPermission(client, interaction, selectMenu))
      )
        return

      // Run select menu
      try {
        await selectMenu.run(client, interaction)
      } catch (err) {
        if (err instanceof Error) logger.error(err.stack)
        else logger.error(err)
      }
    }
  },
)


================================================
FILE: src/events/messageCreate.ts
================================================
import { Event } from '@structures'
import { EmbedBuilder, Events } from 'discord.js'
import { Color, Image } from 'enums'

export default new Event(Events.MessageCreate, async (client, message) => {
  const { guild, channel, author, content } = message

  if (!client.isReady() || author.bot) return
  if (
    content === `<@${client.user.id}>` ||
    content === `<@!${client.user.id}>`
  ) {
    const embed = new EmbedBuilder()
      .setTitle(
        `Hi, I'm ${
          guild?.members.me?.displayName ?? client.user.username
        }. Need help?`,
      )
      .setThumbnail(Image.Calypso)
      .setColor(guild?.members.me?.displayHexColor ?? Color.Default)
      .setDescription(
        'You can see everything I can do by using the `/help` command.',
      )
      .setFooter({
        text: 'DM Nettles#8880 to speak directly with the developer!',
      })

    await client.send(channel, { embeds: [embed] })
  }
})


================================================
FILE: src/events/ready.ts
================================================
import prisma from 'prisma'
import { type ActivitiesOptions, ActivityType, Events } from 'discord.js'
import logger from 'logger'
import { Event } from '@structures'

export default new Event(Events.ClientReady, async (client) => {
  if (!client.isReady()) return
  const { user, guilds } = client

  const activities: ActivitiesOptions[][] = [
    [{ name: 'your commands', type: ActivityType.Listening }],
    [{ name: '@Calypso', type: ActivityType.Listening }],
  ]

  // Update presence
  user.setPresence({ status: 'online', activities: activities[0] })

  let activity = 1

  // Update activity every 30 seconds
  setInterval(() => {
    activities[2] = [
      {
        name: `${guilds.cache.size} servers`,
        type: ActivityType.Watching,
      },
    ] // Update server count
    if (activity > 2) activity = 0
    user.setActivity(activities[activity][0])
    activity++
  }, 30000)

  // Update guilds
  logger.info('Updating guilds...')
  for (const guild of guilds.cache.values()) {
    const { id: guildId, name } = guild
    await prisma.guild.upsert({
      where: {
        guildId,
      },
      update: {
        name,
      },
      create: {
        guildId,
        name,
        config: {},
      },
    })
  }

  logger.info(`${user.username} is now online`)
  logger.info(`${user.username} is running on ${guilds.cache.size} server(s)`)
})


================================================
FILE: src/events/warn.ts
================================================
import { Event } from '@structures'
import { Events } from 'discord.js'
import logger from 'logger'

export default new Event(Events.Warn, (message) => {
  logger.warn(message)
})


================================================
FILE: src/logger.ts
================================================
import { createLogger, format, transports } from 'winston'

// Instantiate logger
const logger = createLogger({
  transports: [new transports.Console()],
  format: format.combine(
    format.colorize(),
    format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
    format.printf(({ timestamp, level, message }) => {
      return `[${timestamp as string}] ${level}: ${message as string}`
    }),
  ),
})

export default logger


================================================
FILE: src/prisma.ts
================================================
import { PrismaClient } from '@prisma/client'

export default new PrismaClient()


================================================
FILE: src/structures/Client.ts
================================================
import chalk from 'chalk'
import Table from 'cli-table3'
import {
  BaseGuildTextChannel,
  type ButtonInteraction,
  type ChatInputCommandInteraction,
  type ClientEvents,
  type ClientOptions,
  Collection,
  Client as DiscordClient,
  EmbedBuilder,
  type InteractionReplyOptions,
  type InteractionResponse,
  type InteractionUpdateOptions,
  type Message,
  type MessageComponentInteraction,
  type MessageCreateOptions,
  type MessagePayload,
  PermissionFlagsBits,
  type SelectMenuInteraction,
  type Snowflake,
  type TextBasedChannel,
  type WebhookEditMessageOptions,
} from 'discord.js'
import glob from 'glob'
import logger from 'logger'
import { basename, sep } from 'path'
import { promisify } from 'util'
import { Color, Emoji, type ErrorType } from 'enums'
import type { Event } from '@structures/Event'
import type { Command } from '@structures/Command'
import type { Component } from '@structures/Component'
import { ConfigCache } from '@structures/ConfigCache'
import type { StructureImport } from 'types'

const glob_ = promisify(glob)

/**
 * Interface of all available options used by the client for its config.
 */
interface ClientConfig {
  token: string
  ownerIds: Snowflake[]
  feedbackChannelId: Snowflake
  bugReportChannelId: Snowflake
  debug: boolean
}

const styling: Table.TableConstructorOptions = {
  chars: { mid: '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },
  style: {
    head: ['yellow'],
  },
}

/**
 * The Client class provides the structure for the bot itself.
 *
 * @remarks
 * This should only ever be instantiated once.
 */
export class Client<
  Ready extends boolean = boolean,
> extends DiscordClient<Ready> {
  /** The client token. */
  readonly #token: string

  /** List of owner IDs. */
  public readonly ownerIds: Snowflake[]

  /** The feedback channel ID. */
  public readonly feedbackChannelId: Snowflake

  /** The bug report channel ID. */
  public readonly bugReportChannelId: Snowflake

  /** Whether or not debug mode is enabled. */
  public readonly debug: boolean

  /**
   * Collection of all guild configs mapped by their guild ID.
   *
   * @defaultValue `new ConfigCache()`
   */
  public configs: ConfigCache = new ConfigCache()

  /**
   * Collection of all commands mapped by their name.
   *
   * @defaultValue `new Collection()`
   */
  public commands: Collection<string, Command> = new Collection()

  /**
   * Collection of all buttons mapped by their custom ID.
   *
   * @defaultValue `new Collection()`
   */
  public buttons: Collection<string, Component<ButtonInteraction>> =
    new Collection()

  /**
   * Collection of all select menus mapped by their custom ID.
   *
   * @defaultValue `new Collection()`
   */
  public selectMenus: Collection<string, Component<SelectMenuInteraction>> =
    new Collection()

  public constructor(
    {
      token,
      ownerIds,
      feedbackChannelId,
      bugReportChannelId,
      debug,
    }: ClientConfig,
    options: ClientOptions,
  ) {
    super(options)

    this.#token = token
    this.ownerIds = ownerIds
    this.feedbackChannelId = feedbackChannelId
    this.bugReportChannelId = bugReportChannelId
    this.debug = debug
  }

  /**
   * Loads all events and registers them to the client.
   */
  async #registerEvents(): Promise<void> {
    logger.info('Registering events...')

    const files = await glob_(
      `${__dirname.split(sep).join('/')}/../events/*{.ts,.js}`,
    )
    if (files.length === 0) {
      logger.warn('No events found')
      return
    }

    const table = new Table({
      head: ['File', 'Name', 'Status'],
      ...styling,
    })

    let count = 0

    for (const f of files) {
      let name = basename(f)
      name = name.substring(0, name.lastIndexOf('.')) || name
      if (name === 'debug' && !this.debug) continue

      try {
        const event = (
          (await import(f)) as StructureImport<Event<keyof ClientEvents>>
        ).default
        this.on(event.event, event.run.bind(null, this))
        table.push([f, name, chalk.green('pass')])
        count++
      } catch (err) {
        if (err instanceof Error) {
          logger.error(`Event failed to register: ${name}`)
          logger.error(err.stack)
          table.push([f, name, chalk.red('fail')])
        } else logger.error(err)
      }
    }

    logger.info(`\n${table.toString()}`)
    logger.info(`Registered ${count} event(s)`)
  }

  /**
   * Handles loading commands and mapping them in the commands collection.
   */
  async #registerCommands(): Promise<void> {
    logger.info('Registering commands...')

    const files = await glob_(
      `${__dirname.split(sep).join('/')}/../commands/*/*{.ts,.js}`,
    )
    if (files.length === 0) {
      logger.warn('No commands found')
      return
    }

    const table = new Table({
      head: ['File', 'Name', 'Type', 'Status'],
      ...styling,
    })

    let count = 0

    for (const f of files) {
      let name = basename(f)
      name = name.substring(0, name.lastIndexOf('.')) || name

      try {
        const command = ((await import(f)) as StructureImport<Command>).default
        if (command.data.name) {
          this.commands.set(command.data.name, command)
          table.push([f, name, command.type, chalk.green('pass')])
          count++
        } else throw Error(`Command name not set: ${name}`)
      } catch (err) {
        if (err instanceof Error) {
          logger.error(`Command failed to register: ${name}`)
          logger.error(err.stack)
          table.push([f, name, '', chalk.red('fail')])
        } else logger.error(err)
      }
    }

    logger.info(`\n${table.toString()}`)
    logger.info(`Registered ${count} command(s)`)
  }

  /**
   * Handles loading components and mapping them in their respective collection.
   */
  async #registerComponents(): Promise<void> {
    logger.info('Registering components...')

    const files = await glob_(
      `${__dirname.split(sep).join('/')}/../components/*/*{.ts,.js}`,
    )
    if (files.length === 0) {
      logger.warn('No components found')
      return
    }

    const table = new Table({
      head: ['File', 'Name', 'Type', 'Status'],
      ...styling,
    })

    let count = 0

    for (const f of files) {
      let name = basename(f)
      name = name.substring(0, name.lastIndexOf('.')) || name
      const type = f.split('/').at(-2) as 'buttons' | 'selectMenus'

      try {
        const component = (
          (await import(f)) as StructureImport<
            Component<MessageComponentInteraction>
          >
        ).default
        const { customId } = component
        if (customId) {
          this[type].set(customId, component)
          table.push([f, name, type, chalk.green('pass')])
          count++
        } else throw Error(`Component custom ID not set: ${name}`)
      } catch (err) {
        if (err instanceof Error) {
          logger.error(`Component failed to register: ${name}`)
          logger.error(err.stack)
          table.push([f, name, type, chalk.red('fail')])
        } else logger.error(err)
      }
    }

    logger.info(`\n${table.toString()}`)
    logger.info(`Registered ${count} component(s)`)
  }

  /**
   * Checks if the bot is allowed to respond in a channel.
   *
   * @param channel - The channel that should be checked
   * @returns `true` or `false`
   */
  public isAllowed(channel: TextBasedChannel): boolean {
    if (
      channel instanceof BaseGuildTextChannel &&
      (!channel.guild.members.me ||
        !channel.viewable ||
        !channel
          .permissionsFor(channel.guild.members.me)
          .has(
            PermissionFlagsBits.ViewChannel | PermissionFlagsBits.SendMessages,
          ))
    )
      return false
    else return true
  }

  /**
   * Sends a message safely by checking channel permissions before sending the message.
   *
   * @param channel - The channel to send the message in
   * @param options - Options for configuring the message
   * @returns The message sent
   */
  public async send(
    channel: TextBasedChannel,
    options: string | MessagePayload | MessageCreateOptions,
  ): Promise<Message | undefined> {
    if (!this.isAllowed(channel)) return
    return channel.send(options)
  }

  /**
   * Replies safely by checking channel permissions before sending the response.
   *
   * @param options - Options for configuring the interaction reply
   * @returns The message or interaction response
   */
  // Steal the overloads \o/
  public reply(
    interaction:
      | ChatInputCommandInteraction
      | ButtonInteraction
      | SelectMenuInteraction,
    options: InteractionReplyOptions & { fetchReply: true },
  ): Promise<Message>
  public reply(
    interaction:
      | ChatInputCommandInteraction
      | ButtonInteraction
      | SelectMenuInteraction,
    options: string | MessagePayload | InteractionReplyOptions,
  ): Promise<InteractionResponse>
  public async reply(
    interaction:
      | ChatInputCommandInteraction
      | ButtonInteraction
      | SelectMenuInteraction,
    options: string | MessagePayload | InteractionReplyOptions,
  ): Promise<Message | InteractionResponse | undefined> {
    const { channel } = interaction
    if (interaction.inCachedGuild() && channel && !this.isAllowed(channel))
      return
    return interaction.reply(options)
  }

  /**
   * Edits the reply safely by checking channel permissions before editing.
   *
   * @param options - Options for configuring the interaction edit
   * @returns The edited message
   */
  public async editReply(
    interaction:
      | ChatInputCommandInteraction
      | ButtonInteraction
      | SelectMenuInteraction,
    options: string | MessagePayload | WebhookEditMessageOptions,
  ): Promise<Message | undefined> {
    const { channel } = interaction
    if (interaction.inCachedGuild() && channel && !this.isAllowed(channel))
      return
    return interaction.editReply(options)
  }

  /**
   * Updates the interaction safely by checking channel permissions before updating.
   *
   * @param options - Options for configuring the interaction update
   * @returns The updated message or interaction response
   */
  // Steal the overloads again \o/ \o/
  public update(
    interaction: MessageComponentInteraction,
    options: InteractionUpdateOptions & { fetchReply: true },
  ): Promise<Message>
  public update(
    interaction: MessageComponentInteraction,
    options: string | MessagePayload | InteractionUpdateOptions,
  ): Promise<InteractionResponse>
  public async update(
    interaction: MessageComponentInteraction,
    options: string | MessagePayload | InteractionUpdateOptions,
  ): Promise<Message | InteractionResponse | undefined> {
    const { channel } = interaction
    if (interaction.inCachedGuild() && channel && !this.isAllowed(channel))
      return
    return interaction.update(options)
  }

  /**
   * Helper function to provide a standardized way of responding to the user with an error message.
   *
   * @param type - The type of error
   * @param message - The error message to be sent to the user
   */
  public async replyWithError(
    interaction:
      | ChatInputCommandInteraction
      | ButtonInteraction
      | SelectMenuInteraction,
    type: ErrorType,
    message: string,
  ): Promise<void> {
    if (!this.isReady()) return
    const { user } = interaction
    const member = interaction.inCachedGuild() ? interaction.member : null
    await this.reply(interaction, {
      embeds: [
        new EmbedBuilder()
          .setAuthor({
            name: this.user.tag,
            iconURL: this.user.displayAvatarURL(),
          })
          .setTitle(`${Emoji.Fail}  Error: \`${type}\``)
          .setDescription(message)
          .setFooter({
            text: member?.displayName ?? user.username,
            iconURL: member?.displayAvatarURL() ?? user.displayAvatarURL(),
          })
          .setColor(Color.Error)
          .setTimestamp(),
      ],
      ephemeral: true,
    })
  }

  /**
   * Initializes the client.
   */
  public async init(): Promise<void> {
    await this.#registerEvents()
    await this.#registerCommands()
    await this.#registerComponents()
    await this.login(this.#token)
  }
}


================================================
FILE: src/structures/Command.ts
================================================
import {
  type ChatInputCommandInteraction,
  type GuildMember,
  PermissionsBitField,
  type SlashCommandBuilder,
  type User,
} from 'discord.js'
import { CommandType } from 'enums'
import type { Permissions, RunFunction } from 'types'

/**
 * Type definition of a slash command.
 */
type SlashCommand =
  | SlashCommandBuilder
  | Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>

/**
 * Interface of all available options used for command creation.
 */
interface CommandOptions {
  data: SlashCommand
  type?: CommandType
  permissions?: Permissions
  run: RunFunction<ChatInputCommandInteraction>
}

/**
 * The Command class provides the structure for all bot commands.
 */
export class Command {
  /** Data representing a slash command which will be sent to the Discord API. */
  public readonly data: SlashCommand

  /**
   * The command type.
   *
   * @defaultValue `CommandType.Miscellaneous`
   */
  public readonly type: CommandType

  /**
   * List of client permissions needed to run the command.
   *
   * @defaultValue `[PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages]`
   */
  public readonly permissions: Permissions

  /** Handles all logic relating to command execution. */
  public run: RunFunction<ChatInputCommandInteraction>

  public constructor({
    data,
    type = CommandType.Miscellaneous,
    permissions = [
      PermissionsBitField.Flags.SendMessages,
      PermissionsBitField.Flags.ViewChannel,
    ],
    run,
  }: CommandOptions) {
    this.data = data
    this.type = type
    this.permissions = permissions
    this.run = run
  }

  /**
   * Determines the member the command is targeting.
   * If no user was given as a command argument, then the original user becomes the target.
   *
   * @remarks
   * `targetMember` should be used anywhere requiring the interaction option user.
   * `member` references the original user who created the interaction.
   *
   * @param interaction - The interaction that spawned the command
   * @returns An object containing the target member and original member
   */
  public static getMember(interaction: ChatInputCommandInteraction<'cached'>): {
    targetMember: GuildMember
    member: GuildMember
  }
  public static getMember(interaction: ChatInputCommandInteraction): {
    targetMember: GuildMember | null
    member: GuildMember | null
  }
  public static getMember(interaction: ChatInputCommandInteraction): {
    targetMember: GuildMember | null
    member: GuildMember | null
  } {
    if (!interaction.inCachedGuild())
      return { targetMember: null, member: null }
    const { member, options } = interaction
    const targetMember = options.getMember('user') ?? member
    return { targetMember, member }
  }

  /**
   * Determines the user or member the command is targeting.
   * If no user was given as a command argument, then the original user becomes the target.
   *
   * @remarks
   * `targetMember` and `targetUser` should be used anywhere requiring the interaction option user.
   * `member` and `user` reference the original user who created the interaction.
   *
   * @param interaction - The interaction that spawned the command
   * @returns An object containing the target member, original member, target user, and original user
   */
  public static getMemberAndUser(interaction: ChatInputCommandInteraction): {
    targetMember: GuildMember | null
    member: GuildMember | null
    targetUser: User
    user: User
  } {
    const { user, options } = interaction
    const targetUser = options.getUser('user') ?? user
    const { targetMember, member } = this.getMember(interaction)
    return { targetMember, member, targetUser, user }
  }
}


================================================
FILE: src/structures/Component.ts
================================================
import {
  type MessageComponentInteraction,
  PermissionsBitField,
} from 'discord.js'
import type { Permissions, RunFunction } from 'types'

/**
 * Interface of all available options used for component creation.
 */
export interface ComponentOptions<
  TInteraction extends MessageComponentInteraction,
> {
  customId: string
  permissions?: Permissions
  run: RunFunction<TInteraction>
}

/**
 * The generic Component class provides the structure for all components.
 */
export class Component<TInteraction extends MessageComponentInteraction> {
  public readonly customId: string

  /**
   * List of client permissions needed to use the component.
   *
   * @defaultValue `[PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages]`
   */
  public readonly permissions: Permissions

  /** Handles all logic relating to component execution. */
  public run: RunFunction<TInteraction>

  public constructor({
    customId,
    permissions = [
      PermissionsBitField.Flags.SendMessages,
      PermissionsBitField.Flags.ViewChannel,
    ],
    run,
  }: ComponentOptions<TInteraction>) {
    this.customId = customId
    this.permissions = permissions
    this.run = run
  }
}


================================================
FILE: src/structures/ConfigCache.ts
================================================
import { Collection, type Snowflake } from 'discord.js'
import type { Config } from '@prisma/client'
import prisma from 'prisma'

export class ConfigCache extends Collection<Snowflake, Config | undefined> {
  /**
   * Gets a cached guild config or fetches it from the database if not present.
   *
   * @param guildId - The ID of the guild to get or fetch
   * @returns The cached config
   */
  public async fetch(guildId: Snowflake): Promise<Config | undefined> {
    if (!this.has(guildId)) {
      super.set(
        guildId,
        (await prisma.guild.findUnique({ where: { guildId } }))?.config,
      )
    }
    return super.get(guildId)
  }

  /**
   * Updates a cached guild config field with the given value.
   *
   * @param guildId - The ID of the guild to update
   * @param field - The field of the guild's config to update
   * @param value - The new value of the field
   */
  public async update<K extends keyof Config>(
    guildId: Snowflake,
    field: keyof Config,
    value: Config[K],
  ): Promise<void> {
    const config = await this.fetch(guildId)
    if (!config)
      throw new Error(
        `Unable to find guild in cache or database with guild ID: ${guildId}`,
      )
    config[field] = value
    await prisma.guild.update({
      where: { guildId },
      data: { config: { [field]: value } },
    })
  }
}


================================================
FILE: src/structures/Event.ts
================================================
import type { ClientEvents } from 'discord.js'
import type { Client } from '@structures/Client'

/**
 * Generic Event class which provides the structure for all events.
 *
 * @typeParam K - Key which must be one of the following event types: {@link https://discord.js.org/#/docs/discord.js/main/typedef/Events}
 */
export class Event<K extends keyof ClientEvents> {
  public constructor(
    /** The event type */
    public event: K,

    /**
     * Handles all logic relating to event execution.
     *
     * @param client - The client to bind to the event
     * @param args - List of arguments for the event
     */
    public run: (
      client: Client,
      ...args: ClientEvents[K]
    ) => Promise<void> | void,
  ) {}
}


================================================
FILE: src/structures/PaginatedEmbed.ts
================================================
import {
  ActionRowBuilder,
  ButtonBuilder,
  type ButtonInteraction,
  ButtonStyle,
  type ChatInputCommandInteraction,
  ComponentType,
  type EmbedBuilder,
  type InteractionCollector,
  type User,
} from 'discord.js'
import type { Client } from '@structures'

enum Button {
  Prev = 'prev',
  Next = 'next',
}

/**
 * Interface of all available options used for paginated embed creation.
 */
interface PaginatedEmbedOptions {
  client: Client<true>
  interaction: ChatInputCommandInteraction
  pages: EmbedBuilder[]
  time?: number
}

/**
 * The PaginatedEmbed class provides the structure for all paginated embeds with button menus.
 */
export class PaginatedEmbed {
  private readonly client: Client<true>

  private readonly interaction: ChatInputCommandInteraction

  public readonly user: User

  public pages: EmbedBuilder[]

  public readonly time: number

  #collector?: InteractionCollector<ButtonInteraction>

  public constructor({
    client,
    interaction,
    pages,
    time,
  }: PaginatedEmbedOptions) {
    this.client = client
    this.interaction = interaction
    this.user = interaction.user
    this.pages = pages
    this.time = time ?? 60000
  }

  public async run(): Promise<void> {
    const { client, interaction, user, pages, time } = this
    let index = 0

    const prev = new ButtonBuilder()
      .setCustomId(Button.Prev)
      .setStyle(ButtonStyle.Primary)
      .setDisabled(index == 0)
      .setEmoji({ name: '◀️' })
    const next = new ButtonBuilder()
      .setCustomId(Button.Next)
      .setStyle(ButtonStyle.Primary)
      .setEmoji({ name: '▶️' })
    const row = new ActionRowBuilder<ButtonBuilder>().setComponents(prev, next)

    const message = await client.reply(interaction, {
      embeds: [pages[index]],
      components: [row],
      fetchReply: true,
    })

    this.#collector = message.createMessageComponentCollector({
      componentType: ComponentType.Button,
      time,
    })

    this.#collector.on('collect', async (i) => {
      if (i.user.id != user.id) return
      const { customId } = i
      switch (customId) {
        case Button.Prev: {
          index--
          break
        }
        case Button.Next: {
          index++
          break
        }
      }

      await client.update(i, {
        embeds: [pages[index]],
        components: [
          row.setComponents(
            prev.setDisabled(index == 0),
            next.setDisabled(index == pages.length - 1),
          ),
        ],
      })
    })

    this.#collector.on('end', async () => {
      await message.edit({
        embeds: [pages[index]],
        components: [],
      })
    })
  }
}


================================================
FILE: src/structures/index.ts
================================================
export { Client } from '@structures/Client'
export { Event } from '@structures/Event'
export { ConfigCache } from '@structures/ConfigCache'
export { Command } from '@structures/Command'
export { Component } from '@structures/Component'
export { PaginatedEmbed } from '@structures/PaginatedEmbed'


================================================
FILE: src/types.ts
================================================
import type {
  BaseInteraction,
  ClientEvents,
  MessageComponentInteraction,
} from 'discord.js'
import type { Client, Command, Component, Event } from '@structures'

/**
 * Generic interface representing a structure import.
 */
export interface StructureImport<
  TStructure extends
    | Event<keyof ClientEvents>
    | Command
    | Component<MessageComponentInteraction>,
> {
  default: TStructure
}

/**
 * Generic definition of a structure's run function.
 *
 * @param Client - The instantiated client
 * @param interaction - The interaction attached to the structure
 */
export type RunFunction<TInteraction extends BaseInteraction> = (
  client: Client<true>,
  interaction: TInteraction,
) => Promise<void> | void

/**
 * Type definition of a list of permissions.
 */
export type Permissions = bigint[]


================================================
FILE: src/utils.ts
================================================
import { type GuildMember, PermissionFlagsBits, type Role } from 'discord.js'
import startCase from 'lodash/startCase'

/**
 * Ensures an environment variable exists or throws an error.
 *
 * @remarks
 * Provides a type safe way to load environment variables.
 * Should only be used when creating the bot config.
 *
 * @param unvalidatedEnvironmentVariable - The initial environment variable before it has been type-checked
 * @returns Validated environment variable
 */
const getEnvironmentVariable = (
  unvalidatedEnvironmentVariable: string,
): string => {
  const environmentVariable = process.env[unvalidatedEnvironmentVariable]
  if (!environmentVariable) {
    throw new Error(
      `Environment variable not set: ${unvalidatedEnvironmentVariable}`,
    )
  } else {
    return environmentVariable
  }
}

/**
 * Gets a list of all permissions of the target and marks them as enabled or disabled.
 *
 * @remarks
 * This is specifically designed to be used with the `diff` syntax highlighting.
 *
 * @param target - The member or role to get permissions of
 * @returns A list of all permissions
 */
const getPermissions = (target: GuildMember | Role): string[] => {
  const rolePermissions = target.permissions.toArray() as string[]
  const allPermissions = Object.keys(PermissionFlagsBits)
  const permissions = []
  for (const permission of allPermissions) {
    if (rolePermissions.includes(permission))
      permissions.push(`+ ${startCase(permission)}`)
    else permissions.push(`- ${startCase(permission)}`)
  }
  return permissions
}

export { getEnvironmentVariable, getPermissions }


================================================
FILE: tsconfig.json
================================================
{
  "ts-node": {
    "require": ["tsconfig-paths/register"]
  },
  "compilerOptions": {
    "target": "ESNext",
    "module": "CommonJS",
    "lib": ["ESNext"],
    "sourceMap": false,
    "outDir": "dist",
    "strict": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "importHelpers": true,
    "baseUrl": "src",
    "paths": {
      "@structures": ["structures"],
      "@structures/*": ["structures/*"],
      "@commands/*": ["commands/*"]
    },
    "noImplicitAny": true,
    "resolveJsonModule": true
  },
  "include": ["deploy.ts", "src"],
  "exclude": ["dist", "node_modules"]
}
Download .txt
gitextract_k5hgb30w/

├── .commitlintrc.json
├── .devcontainer/
│   ├── Dockerfile
│   └── devcontainer.json
├── .eslintrc
├── .github/
│   └── workflows/
│       └── node.js.yml
├── .gitignore
├── .husky/
│   ├── commit-msg
│   ├── pre-commit
│   └── prepare-commit-msg
├── .prettierrc
├── .vscode/
│   ├── extensions.json
│   ├── launch.json
│   └── settings.json
├── LICENSE
├── README.md
├── deploy.ts
├── package.json
├── prisma/
│   └── schema.prisma
├── src/
│   ├── app.ts
│   ├── commands/
│   │   ├── animals/
│   │   │   ├── bird.ts
│   │   │   ├── cat.ts
│   │   │   ├── catfact.ts
│   │   │   ├── dog.ts
│   │   │   ├── dogfact.ts
│   │   │   ├── duck.ts
│   │   │   ├── fox.ts
│   │   │   └── shibe.ts
│   │   ├── color/
│   │   │   ├── color.ts
│   │   │   └── randomcolor.ts
│   │   ├── fun/
│   │   │   ├── coinflip.ts
│   │   │   ├── meme.ts
│   │   │   ├── thouart.ts
│   │   │   ├── wholesomememe.ts
│   │   │   ├── yesno.ts
│   │   │   └── yomama.ts
│   │   ├── information/
│   │   │   ├── avatar.ts
│   │   │   ├── botinfo.ts
│   │   │   ├── botstats.ts
│   │   │   ├── channelinfo.ts
│   │   │   ├── donate.ts
│   │   │   ├── findid.ts
│   │   │   ├── github.ts
│   │   │   ├── help.ts
│   │   │   ├── inviteme.ts
│   │   │   ├── memberstatus.ts
│   │   │   ├── permissions.ts
│   │   │   ├── ping.ts
│   │   │   ├── roleinfo.ts
│   │   │   ├── servericon.ts
│   │   │   ├── serverinfo.ts
│   │   │   ├── supportserver.ts
│   │   │   ├── uptime.ts
│   │   │   └── userinfo.ts
│   │   └── miscellaneous/
│   │       ├── feedback.ts
│   │       └── reportbug.ts
│   ├── components/
│   │   └── selectMenus/
│   │       └── help.ts
│   ├── config.ts
│   ├── enums.ts
│   ├── events/
│   │   ├── debug.ts
│   │   ├── error.ts
│   │   ├── guildCreate.ts
│   │   ├── interactionCreate.ts
│   │   ├── messageCreate.ts
│   │   ├── ready.ts
│   │   └── warn.ts
│   ├── logger.ts
│   ├── prisma.ts
│   ├── structures/
│   │   ├── Client.ts
│   │   ├── Command.ts
│   │   ├── Component.ts
│   │   ├── ConfigCache.ts
│   │   ├── Event.ts
│   │   ├── PaginatedEmbed.ts
│   │   └── index.ts
│   ├── types.ts
│   └── utils.ts
└── tsconfig.json
Download .txt
SYMBOL INDEX (41 symbols across 8 files)

FILE: src/enums.ts
  type CommandType (line 4) | enum CommandType {
  type ErrorType (line 15) | enum ErrorType {
  type Emoji (line 27) | enum Emoji {
  type Color (line 52) | enum Color {
  type Image (line 60) | enum Image {
  type Url (line 68) | enum Url {

FILE: src/structures/Client.ts
  type ClientConfig (line 41) | interface ClientConfig {
  class Client (line 62) | class Client<
    method constructor (line 110) | public constructor(
    method #registerEvents (line 132) | async #registerEvents(): Promise<void> {
    method #registerCommands (line 178) | async #registerCommands(): Promise<void> {
    method #registerComponents (line 223) | async #registerComponents(): Promise<void> {
    method isAllowed (line 277) | public isAllowed(channel: TextBasedChannel): boolean {
    method send (line 299) | public async send(
    method reply (line 328) | public async reply(
    method editReply (line 347) | public async editReply(
    method update (line 375) | public async update(
    method replyWithError (line 391) | public async replyWithError(
    method init (line 425) | public async init(): Promise<void> {

FILE: src/structures/Command.ts
  type SlashCommand (line 14) | type SlashCommand =
  type CommandOptions (line 21) | interface CommandOptions {
  class Command (line 31) | class Command {
    method constructor (line 52) | public constructor({
    method getMember (line 86) | public static getMember(interaction: ChatInputCommandInteraction): {
    method getMemberAndUser (line 108) | public static getMemberAndUser(interaction: ChatInputCommandInteractio...

FILE: src/structures/Component.ts
  type ComponentOptions (line 10) | interface ComponentOptions<
  class Component (line 21) | class Component<TInteraction extends MessageComponentInteraction> {
    method constructor (line 34) | public constructor({

FILE: src/structures/ConfigCache.ts
  class ConfigCache (line 5) | class ConfigCache extends Collection<Snowflake, Config | undefined> {
    method fetch (line 12) | public async fetch(guildId: Snowflake): Promise<Config | undefined> {
    method update (line 29) | public async update<K extends keyof Config>(

FILE: src/structures/Event.ts
  class Event (line 9) | class Event<K extends keyof ClientEvents> {
    method constructor (line 10) | public constructor(

FILE: src/structures/PaginatedEmbed.ts
  type Button (line 14) | enum Button {
  type PaginatedEmbedOptions (line 22) | interface PaginatedEmbedOptions {
  class PaginatedEmbed (line 32) | class PaginatedEmbed {
    method constructor (line 45) | public constructor({
    method run (line 58) | public async run(): Promise<void> {

FILE: src/types.ts
  type StructureImport (line 11) | interface StructureImport<
  type RunFunction (line 26) | type RunFunction<TInteraction extends BaseInteraction> = (
  type Permissions (line 34) | type Permissions = bigint[]
Condensed preview — 77 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (164K chars).
[
  {
    "path": ".commitlintrc.json",
    "chars": 53,
    "preview": "{\n  \"extends\": [\"@commitlint/config-conventional\"]\n}\n"
  },
  {
    "path": ".devcontainer/Dockerfile",
    "chars": 249,
    "preview": "ARG VARIANT=18-bullseye\nFROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}\n\n# Install packages\nRUN"
  },
  {
    "path": ".devcontainer/devcontainer.json",
    "chars": 607,
    "preview": "{\n  \"name\": \"CalypsoBot Dev Container\",\n  \"build\": {\n    \"dockerfile\": \"Dockerfile\",\n    \"args\": {\n      \"VARIANT\": \"18-"
  },
  {
    "path": ".eslintrc",
    "chars": 1659,
    "preview": "{\n  \"root\": true,\n  \"parser\": \"@typescript-eslint/parser\",\n  \"parserOptions\": {\n    \"ecmaVersion\": 12,\n    \"sourceType\":"
  },
  {
    "path": ".github/workflows/node.js.yml",
    "chars": 681,
    "preview": "name: Node.js CI\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n\njobs:\n  ci:\n    run"
  },
  {
    "path": ".gitignore",
    "chars": 2046,
    "preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports"
  },
  {
    "path": ".husky/commit-msg",
    "chars": 67,
    "preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpx commitlint --edit $1\n"
  },
  {
    "path": ".husky/pre-commit",
    "chars": 58,
    "preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpx lint-staged\n"
  },
  {
    "path": ".husky/prepare-commit-msg",
    "chars": 118,
    "preview": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nif [ -z \"${2-}\" ]; then\n  exec < /dev/tty && node_modules/.bin/cz --hook\nfi\n"
  },
  {
    "path": ".prettierrc",
    "chars": 112,
    "preview": "{\n  \"trailingComma\": \"all\",\n  \"tabWidth\": 2,\n  \"bracketSpacing\": true,\n  \"semi\": false,\n  \"singleQuote\": true\n}\n"
  },
  {
    "path": ".vscode/extensions.json",
    "chars": 156,
    "preview": "{\n  \"recommendations\": [\n    \"dbaeumer.vscode-eslint\",\n    \"esbenp.prettier-vscode\",\n    \"streetsidesoftware.code-spell-"
  },
  {
    "path": ".vscode/launch.json",
    "chars": 515,
    "preview": "{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"name\": \"Debug\",\n      \"type\": \"node\",\n      \"request\": \"launc"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 861,
    "preview": "{\n  \"editor.tabSize\": 2,\n  \"editor.insertSpaces\": true,\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n  \"editor"
  },
  {
    "path": "LICENSE",
    "chars": 34881,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\nCopyright (C) 2007 Free S"
  },
  {
    "path": "README.md",
    "chars": 997,
    "preview": "<h1 align=\"center\">\n  <br>\n  <a href=\"https://github.com/sabattle/CalypsoBot\"><img src=\"./images/Calypso_Title.png\"></a>"
  },
  {
    "path": "deploy.ts",
    "chars": 1812,
    "preview": "import { REST } from '@discordjs/rest'\nimport { Routes } from 'discord-api-types/v10'\nimport logger from 'logger'\nimport"
  },
  {
    "path": "package.json",
    "chars": 2951,
    "preview": "{\n  \"name\": \"calypso-bot\",\n  \"version\": \"0.0.1\",\n  \"description\": \"A fully customizable bot built with discord.js\",\n  \"m"
  },
  {
    "path": "prisma/schema.prisma",
    "chars": 342,
    "preview": "datasource db {\n  provider = \"mongodb\"\n  url      = env(\"DATABASE_URL\")\n}\n\ngenerator client {\n  provider = \"prisma-clien"
  },
  {
    "path": "src/app.ts",
    "chars": 462,
    "preview": "import { Client } from '@structures'\nimport config from 'config'\nimport { GatewayIntentBits, Partials } from 'discord.js"
  },
  {
    "path": "src/commands/animals/bird.ts",
    "chars": 1225,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/animals/cat.ts",
    "chars": 1292,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/animals/catfact.ts",
    "chars": 1238,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/animals/dog.ts",
    "chars": 1248,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/animals/dogfact.ts",
    "chars": 1259,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/animals/duck.ts",
    "chars": 1237,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/animals/fox.ts",
    "chars": 1245,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/animals/shibe.ts",
    "chars": 1232,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/color/color.ts",
    "chars": 1701,
    "preview": "import {\n  EmbedBuilder,\n  PermissionFlagsBits,\n  SlashCommandBuilder,\n} from 'discord.js'\nimport { Command, PaginatedEm"
  },
  {
    "path": "src/commands/color/randomcolor.ts",
    "chars": 2196,
    "preview": "import {\n  EmbedBuilder,\n  PermissionFlagsBits,\n  SlashCommandBuilder,\n} from 'discord.js'\nimport { Command } from '@str"
  },
  {
    "path": "src/commands/fun/coinflip.ts",
    "chars": 986,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/fun/meme.ts",
    "chars": 1331,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/fun/thouart.ts",
    "chars": 1553,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/fun/wholesomememe.ts",
    "chars": 1354,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/fun/yesno.ts",
    "chars": 1573,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/fun/yomama.ts",
    "chars": 1640,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/information/avatar.ts",
    "chars": 1258,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { CommandTyp"
  },
  {
    "path": "src/commands/information/botinfo.ts",
    "chars": 3012,
    "preview": "import { oneLine, stripIndents } from 'common-tags'\nimport {\n  ActionRowBuilder,\n  ButtonBuilder,\n  ButtonStyle,\n  Embed"
  },
  {
    "path": "src/commands/information/botstats.ts",
    "chars": 2886,
    "preview": "import { stripIndent } from 'common-tags'\nimport dayjs from 'dayjs'\nimport duration from 'dayjs/plugin/duration'\nimport "
  },
  {
    "path": "src/commands/information/channelinfo.ts",
    "chars": 2504,
    "preview": "import dayjs from 'dayjs'\nimport { Collection, EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } "
  },
  {
    "path": "src/commands/information/donate.ts",
    "chars": 1638,
    "preview": "import {\n  ActionRowBuilder,\n  ButtonBuilder,\n  ButtonStyle,\n  EmbedBuilder,\n  SlashCommandBuilder,\n} from 'discord.js'\n"
  },
  {
    "path": "src/commands/information/findid.ts",
    "chars": 1323,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/information/github.ts",
    "chars": 1672,
    "preview": "import { stripIndents } from 'common-tags'\nimport {\n  ActionRowBuilder,\n  ButtonBuilder,\n  ButtonStyle,\n  EmbedBuilder,\n"
  },
  {
    "path": "src/commands/information/help.ts",
    "chars": 4116,
    "preview": "import { oneLine } from 'common-tags'\nimport {\n  type APIApplicationCommandOptionChoice,\n  ActionRowBuilder,\n  ButtonBui"
  },
  {
    "path": "src/commands/information/inviteme.ts",
    "chars": 1491,
    "preview": "import {\n  ActionRowBuilder,\n  ButtonBuilder,\n  ButtonStyle,\n  EmbedBuilder,\n  SlashCommandBuilder,\n} from 'discord.js'\n"
  },
  {
    "path": "src/commands/information/memberstatus.ts",
    "chars": 1886,
    "preview": "import { stripIndents } from 'common-tags'\nimport { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Comma"
  },
  {
    "path": "src/commands/information/permissions.ts",
    "chars": 1230,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { CommandTyp"
  },
  {
    "path": "src/commands/information/ping.ts",
    "chars": 1412,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/information/roleinfo.ts",
    "chars": 2621,
    "preview": "import dayjs from 'dayjs'\nimport { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@struc"
  },
  {
    "path": "src/commands/information/servericon.ts",
    "chars": 875,
    "preview": "import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Command } from '@structures'\nimport { Color, Com"
  },
  {
    "path": "src/commands/information/serverinfo.ts",
    "chars": 5523,
    "preview": "import { stripIndent } from 'common-tags'\nimport dayjs from 'dayjs'\nimport duration from 'dayjs/plugin/duration'\nimport "
  },
  {
    "path": "src/commands/information/supportserver.ts",
    "chars": 1543,
    "preview": "import {\n  ActionRowBuilder,\n  ButtonBuilder,\n  ButtonStyle,\n  EmbedBuilder,\n  SlashCommandBuilder,\n} from 'discord.js'\n"
  },
  {
    "path": "src/commands/information/uptime.ts",
    "chars": 1831,
    "preview": "import dayjs from 'dayjs'\nimport duration from 'dayjs/plugin/duration'\nimport advancedFormat from 'dayjs/plugin/advanced"
  },
  {
    "path": "src/commands/information/userinfo.ts",
    "chars": 4881,
    "preview": "import dayjs from 'dayjs'\nimport type { UserFlagsString } from 'discord.js'\nimport { ActivityType, EmbedBuilder, SlashCo"
  },
  {
    "path": "src/commands/miscellaneous/feedback.ts",
    "chars": 2310,
    "preview": "import { stripIndents } from 'common-tags'\nimport { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Comma"
  },
  {
    "path": "src/commands/miscellaneous/reportbug.ts",
    "chars": 2341,
    "preview": "import { stripIndents } from 'common-tags'\nimport { EmbedBuilder, SlashCommandBuilder } from 'discord.js'\nimport { Comma"
  },
  {
    "path": "src/components/selectMenus/help.ts",
    "chars": 1628,
    "preview": "import {\n  ActionRowBuilder,\n  type ButtonBuilder,\n  EmbedBuilder,\n  SelectMenuBuilder,\n  type SelectMenuComponent,\n  ty"
  },
  {
    "path": "src/config.ts",
    "chars": 704,
    "preview": "import { config } from 'dotenv'\nimport { getEnvironmentVariable } from 'utils'\nimport yargs from 'yargs/yargs'\nimport { "
  },
  {
    "path": "src/enums.ts",
    "chars": 2403,
    "preview": "/**\n * Enum representing all possible command types.\n */\nexport enum CommandType {\n  Information = 'information',\n  Fun "
  },
  {
    "path": "src/events/debug.ts",
    "chars": 181,
    "preview": "import { Event } from '@structures'\nimport { Events } from 'discord.js'\nimport logger from 'logger'\n\nexport default new "
  },
  {
    "path": "src/events/error.ts",
    "chars": 174,
    "preview": "import { Event } from '@structures'\nimport { Events } from 'discord.js'\nimport logger from 'logger'\n\nexport default new "
  },
  {
    "path": "src/events/guildCreate.ts",
    "chars": 387,
    "preview": "import prisma from 'prisma'\nimport { Events } from 'discord.js'\nimport logger from 'logger'\nimport { Event } from '@stru"
  },
  {
    "path": "src/events/interactionCreate.ts",
    "chars": 2471,
    "preview": "import {\n  type ButtonInteraction,\n  type ChatInputCommandInteraction,\n  Events,\n  PermissionsBitField,\n  type SelectMen"
  },
  {
    "path": "src/events/messageCreate.ts",
    "chars": 934,
    "preview": "import { Event } from '@structures'\nimport { EmbedBuilder, Events } from 'discord.js'\nimport { Color, Image } from 'enum"
  },
  {
    "path": "src/events/ready.ts",
    "chars": 1373,
    "preview": "import prisma from 'prisma'\nimport { type ActivitiesOptions, ActivityType, Events } from 'discord.js'\nimport logger from"
  },
  {
    "path": "src/events/warn.ts",
    "chars": 180,
    "preview": "import { Event } from '@structures'\nimport { Events } from 'discord.js'\nimport logger from 'logger'\n\nexport default new "
  },
  {
    "path": "src/logger.ts",
    "chars": 425,
    "preview": "import { createLogger, format, transports } from 'winston'\n\n// Instantiate logger\nconst logger = createLogger({\n  transp"
  },
  {
    "path": "src/prisma.ts",
    "chars": 81,
    "preview": "import { PrismaClient } from '@prisma/client'\n\nexport default new PrismaClient()\n"
  },
  {
    "path": "src/structures/Client.ts",
    "chars": 12219,
    "preview": "import chalk from 'chalk'\nimport Table from 'cli-table3'\nimport {\n  BaseGuildTextChannel,\n  type ButtonInteraction,\n  ty"
  },
  {
    "path": "src/structures/Command.ts",
    "chars": 3708,
    "preview": "import {\n  type ChatInputCommandInteraction,\n  type GuildMember,\n  PermissionsBitField,\n  type SlashCommandBuilder,\n  ty"
  },
  {
    "path": "src/structures/Component.ts",
    "chars": 1201,
    "preview": "import {\n  type MessageComponentInteraction,\n  PermissionsBitField,\n} from 'discord.js'\nimport type { Permissions, RunFu"
  },
  {
    "path": "src/structures/ConfigCache.ts",
    "chars": 1345,
    "preview": "import { Collection, type Snowflake } from 'discord.js'\nimport type { Config } from '@prisma/client'\nimport prisma from "
  },
  {
    "path": "src/structures/Event.ts",
    "chars": 732,
    "preview": "import type { ClientEvents } from 'discord.js'\nimport type { Client } from '@structures/Client'\n\n/**\n * Generic Event cl"
  },
  {
    "path": "src/structures/PaginatedEmbed.ts",
    "chars": 2652,
    "preview": "import {\n  ActionRowBuilder,\n  ButtonBuilder,\n  type ButtonInteraction,\n  ButtonStyle,\n  type ChatInputCommandInteractio"
  },
  {
    "path": "src/structures/index.ts",
    "chars": 296,
    "preview": "export { Client } from '@structures/Client'\nexport { Event } from '@structures/Event'\nexport { ConfigCache } from '@stru"
  },
  {
    "path": "src/types.ts",
    "chars": 815,
    "preview": "import type {\n  BaseInteraction,\n  ClientEvents,\n  MessageComponentInteraction,\n} from 'discord.js'\nimport type { Client"
  },
  {
    "path": "src/utils.ts",
    "chars": 1601,
    "preview": "import { type GuildMember, PermissionFlagsBits, type Role } from 'discord.js'\nimport startCase from 'lodash/startCase'\n\n"
  },
  {
    "path": "tsconfig.json",
    "chars": 753,
    "preview": "{\n  \"ts-node\": {\n    \"require\": [\"tsconfig-paths/register\"]\n  },\n  \"compilerOptions\": {\n    \"target\": \"ESNext\",\n    \"mod"
  }
]

About this extraction

This page contains the full source code of the sabattle/CalypsoBot GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 77 files (150.0 KB), approximately 38.2k tokens, and a symbol index with 41 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!