[
  {
    "path": ".dockerignore",
    "content": "settings.json"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug-report.md",
    "content": "---\nname: Bug Report\nabout: Create a report to help us improve\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n**Describe the Bug**\n<!-- Required, provide a clear and concise description of what the bug is. -->\n\n**Steps to Reproduce**\n<!--- Required, provide a link to a live example, -->\n<!--- or an unambiguous set of steps to reproduce this bug. -->\n1.\n2.\n3.\n\n**Expected Behavior**\n<!--- Required, describe what was expected to happen. -->\n\n**Screenshots**\n<!--- Optional, if applicable, add screenshots to help explain your problem. -->\n\n**Environment**\n<!--- Required, please complete the following information: -->\n- OS: <!-- e.g. iOS, Windows 10, Windows 8.1, Windows 7 or Linux  -->\n- Browser: <!-- e.g. Chrome, Firefox, Opera, Edge, etc... -->\n- Version: <!-- e.g. 80.0.334.4 (64-bit) -->\n  <!-- You can get the version by visiting about:support on Firefox, chrome://version on Chrome & Edge, or by clicking Safari > About Safari on Safari -->\n\n**Additional context**\n<!-- Add any other context about the problem here. -->\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature-request.md",
    "content": "---\nname: Feature Request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: feature request\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/config.yml",
    "content": "todo:\r\n  keyword: \"todo\"\r\n"
  },
  {
    "path": ".github/stale.yml",
    "content": "# Number of days of inactivity before an issue becomes stale\r\ndaysUntilStale: 90\r\n# Number of days of inactivity before a stale issue is closed\r\ndaysUntilClose: 7\r\n# Issues with these labels will never be considered stale\r\nexemptLabels:\r\n  - help wanted\r\n# Label to use when marking an issue as stale\r\nstaleLabel: stale\r\n# Comment to post when marking an issue as stale. Set to `false` to disable\r\nmarkComment: >\r\n  This issue has been automatically marked as stale because it has not had\r\n  recent activity. It will be closed if no further activity occurs. Thank you\r\n  for your contributions.\r\n# Comment to post when closing a stale issue. Set to `false` to disable\r\ncloseComment: false\r\n"
  },
  {
    "path": ".github/workflows/add_to_project.yml",
    "content": "name: Add new issue/pr to Awaiting triage\non: [issues, pull_request]\njobs:\n  add-new-issues-to-project-column:\n    runs-on: ubuntu-latest\n    steps:\n    - name: add-new-issues-to-organization-based-project-column\n      uses: docker://takanabe/github-actions-automate-projects:v0.0.1\n      if: github.event_name == 'issues' && github.event.action == 'opened'\n      env:\n        GITHUB_TOKEN: ${{ secrets.DELLYBOT_SECRET }}\n        GITHUB_PROJECT_URL: https://github.com/orgs/discordextremelist/projects/1\n        GITHUB_PROJECT_COLUMN_NAME: Awaiting triage\n"
  },
  {
    "path": ".github/workflows/deploy.yml",
    "content": "name: Deploy\non:\n    push:\n        tags:\n            - \"v*-Release\"\njobs:\n    build:\n        runs-on: ubuntu-latest\n        steps:\n            - name: 'Login to GitHub Container Registry'\n              uses: docker/login-action@v1\n              with:\n                registry: ghcr.io\n                username: ${{github.actor}}\n                password: ${{secrets.GITHUB_TOKEN}}\n            - uses: actions/checkout@v3\n            - name: Build\n              run: docker build -t ghcr.io/discordextremelist/bot:${GITHUB_REF#refs/tags/} .\n            - name: Push\n              run: docker push ghcr.io/discordextremelist/bot:${GITHUB_REF#refs/tags/}\n    deploy:\n        needs: build\n        runs-on: ubuntu-latest\n        steps:\n            - name: Login\n              run: |\n                  mkdir ~/.kube\n                  echo \"${{ secrets.KUBE_CONFIG }}\" > ~/.kube/config\n            - name: Set image\n              run: kubectl set image deployment/bot bot=ghcr.io/discordextremelist/bot:${GITHUB_REF#refs/tags/}\n            - name: Rollout status\n              run: kubectl rollout status deployment/bot\n"
  },
  {
    "path": ".github/workflows/project_high_priority.yml",
    "content": "name: Move issue/pr to correct column when on hold label applied\non:\n  issues:\n    types: [labeled]\njobs:\n  Move_Labeled_Issue_On_Project_Board:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0\n      with:\n        action-token: \"${{ secrets.DELLYBOT_SECRET }}\"\n        project-url: \"https://github.com/orgs/discordextremelist/projects/1\"\n        column-name: \"High Priority\"\n        label-name: \"high priority\"\n"
  },
  {
    "path": ".github/workflows/project_low_priority.yml",
    "content": "name: Move issue/pr to correct column when on hold label applied\non:\n  issues:\n    types: [labeled]\njobs:\n  Move_Labeled_Issue_On_Project_Board:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0\n      with:\n        action-token: \"${{ secrets.DELLYBOT_SECRET }}\"\n        project-url: \"https://github.com/orgs/discordextremelist/projects/1\"\n        column-name: \"Low Priority / Delayed\"\n        label-name: \"low priority\"\n"
  },
  {
    "path": ".github/workflows/project_medium_priority.yml",
    "content": "name: Move issue/pr to correct column when on hold label applied\non:\n  issues:\n    types: [labeled]\njobs:\n  Move_Labeled_Issue_On_Project_Board:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0\n      with:\n        action-token: \"${{ secrets.DELLYBOT_SECRET }}\"\n        project-url: \"https://github.com/orgs/discordextremelist/projects/1\"\n        column-name: \"Moderate Priority\"\n        label-name: \"moderate priority\"\n"
  },
  {
    "path": ".github/workflows/project_on_hold.yml",
    "content": "name: Move issue/pr to correct column when on hold label applied\non:\n  issues:\n    types: [labeled]\njobs:\n  Move_Labeled_Issue_On_Project_Board:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0\n      with:\n        action-token: \"${{ secrets.DELLYBOT_SECRET }}\"\n        project-url: \"https://github.com/orgs/discordextremelist/projects/1\"\n        column-name: \"Low Priority / Delayed\"\n        label-name: \"on hold\"\n"
  },
  {
    "path": ".gitignore",
    "content": "# Created by .ignore support plugin (hsz.mobi)\r\n### Python template\r\n# Byte-compiled / optimized / DLL files\r\n__pycache__/\r\n*.py[cod]\r\n*$py.class\r\n\r\n# C extensions\r\n*.so\r\n\r\n# Distribution / packaging\r\n.Python\r\nbuild/\r\ndevelop-eggs/\r\ndist/\r\ndownloads/\r\neggs/\r\n.eggs/\r\nlib/\r\nlib64/\r\nparts/\r\nsdist/\r\nvar/\r\nwheels/\r\npip-wheel-metadata/\r\nshare/python-wheels/\r\n*.egg-info/\r\n.installed.cfg\r\n*.egg\r\nMANIFEST\r\n\r\n# PyInstaller\r\n#  Usually these files are written by a python script from a template\r\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\r\n*.manifest\r\n*.spec\r\n\r\n# Installer logs\r\npip-log.txt\r\npip-delete-this-directory.txt\r\n\r\n# Unit test / coverage reports\r\nhtmlcov/\r\n.tox/\r\n.nox/\r\n.coverage\r\n.coverage.*\r\n.cache\r\nnosetests.xml\r\ncoverage.xml\r\n*.cover\r\n*.py,cover\r\n.hypothesis/\r\n.pytest_cache/\r\n\r\n# Translations\r\n*.mo\r\n*.pot\r\n\r\n# Django stuff:\r\n*.log\r\nlocal_settings.py\r\ndb.sqlite3\r\ndb.sqlite3-journal\r\n\r\n# Flask stuff:\r\ninstance/\r\n.webassets-cache\r\n\r\n# Scrapy stuff:\r\n.scrapy\r\n\r\n# Sphinx documentation\r\ndocs/_build/\r\n\r\n# PyBuilder\r\ntarget/\r\n\r\n# Jupyter Notebook\r\n.ipynb_checkpoints\r\n\r\n# IPython\r\nprofile_default/\r\nipython_config.py\r\n\r\n# pyenv\r\n.python-version\r\n\r\n# pipenv\r\n#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.\r\n#   However, in case of collaboration, if having platform-specific dependencies or dependencies\r\n#   having no cross-platform support, pipenv may install dependencies that don't work, or not\r\n#   install all needed dependencies.\r\n#Pipfile.lock\r\n\r\n# PEP 582; used by e.g. github.com/David-OConnor/pyflow\r\n__pypackages__/\r\n\r\n# Celery stuff\r\ncelerybeat-schedule\r\ncelerybeat.pid\r\n\r\n# SageMath parsed files\r\n*.sage.py\r\n\r\n# Environments\r\n.env\r\n.venv\r\nenv/\r\nvenv/\r\nENV/\r\nenv.bak/\r\nvenv.bak/\r\n\r\n# Spyder project settings\r\n.spyderproject\r\n.spyproject\r\n\r\n# Rope project settings\r\n.ropeproject\r\n\r\n# mkdocs documentation\r\n/site\r\n\r\n# mypy\r\n.mypy_cache/\r\n.dmypy.json\r\ndmypy.json\r\n\r\n# Pyre type checker\r\n.pyre/\r\n\r\n# Configuration\r\nsettings.json\r\n\r\n# Redis\r\ndump.rdb\r\n\r\n# IDEs\r\n.vscode/\r\n.idea/"
  },
  {
    "path": ".mergify.yml",
    "content": "pull_request_rules:\r\n  - name: Automatic merge when required reviews are approved\r\n    conditions:\r\n      - base=master\r\n      - \"#approved-reviews-by>=1\"\r\n      - status-success=DeepScan\r\n    actions:\r\n      merge:\r\n        method: merge\r\n"
  },
  {
    "path": "CODEOWNERS",
    "content": "* @Carolina2k22 @TheMoksej \r\n\r\nLICENSE @Carolina2k22\r\nCODEOWNERS @Carolina2k22\r\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM python:3.8\nWORKDIR /app\nCOPY . .\nRUN pip install -U -r requirements.txt\nCMD [\"python\", \"./bot.py\"]"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to \nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "README.md",
    "content": "# DEL Bot for DEL Website v5.x.x\n\nLicensing information viewable in LICENSE.md\n\n# Setup\n\n## Requirements\n\n### Python 3\n\nPython 3 is required for the DEL bot to function as it is built using python.\n\n**NOTE:** This has only been tested in Python 3.8 and may be broken on newer or older versions of Python 3.\n\n### PM2 (Optional)\n\nPM2 is optional and allows the DEL bot to auto-restart on crash.\n\n### MongoDB\n\nA MongoDB instance is required - it must match the configuration in the `settings.json` file and the values must be the same as the website instance.\n\n## Setup\n\nInstall all of the dependencies by running `pip install -r requirements.txt`\n\n## Running\n\n### Without PM2\n\nRun the `python bot.py` command, please note python may be python3 on some platforms.\n\n### With PM2\n\nRun the `pm2 start bot.py --name DEL-BOT` command.\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\n## Supported Versions\n\n| Version | Supported          |\n| ------- | ------------------ |\n| 1.1.x   | 🟢 Supported       |\n| 1.0.x   | 🔴 No Support      |\n\n## Reporting a Vulnerability\n\nYou can report a vulnerability by contacting us at [contact@discordextremelist.xyz](mailto:contact@discordextremelist.xyz).\n"
  },
  {
    "path": "bot.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\r\n\r\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\r\n\r\n# This program is free software: you can redistribute it and/or modify\r\n# it under the terms of the GNU Affero General Public License as published\r\n# by the Free Software Foundation, either version 3 of the License, or\r\n# (at your option) any later version.\r\n\r\n# This program is distributed in the hope that it will be useful,\r\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n# GNU Affero General Public License for more details.\r\n\r\n# You should have received a copy of the GNU Affero General Public License\r\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\r\n\r\nimport datetime\r\nimport json\r\nimport logging\r\n\r\nimport colouredlogs\r\nimport discord\r\nfrom discord.ext import commands\r\nfrom motor.motor_asyncio import AsyncIOMotorClient\r\n\r\nfrom ext.checks import NoMod, NoSomething\r\nfrom ext.context import EditingContext\r\n\r\ncolouredlogs.install()\r\n\r\nwith open(\"settings.json\") as content:\r\n    settings = json.load(content)\r\n\r\nlogging.basicConfig(level=logging.INFO)\r\nlogging.getLogger(\"discord\").setLevel(logging.WARNING)\r\n\r\nlogging.info(\"Starting bot\")\r\ndb = AsyncIOMotorClient(settings[\"mongo\"][\"uri\"])[settings[\"mongo\"][\"db\"]]\r\nbotExtensions = [\r\n    \"cogs.help\",\r\n    \"cogs.utility\",\r\n    \"cogs.tickets\",\r\n    \"cogs.tags\",\r\n    \"cogs.notes\",\r\n    \"cogs.admin\",\r\n    \"jishaku\"\r\n]\r\n\r\n\r\nasync def get_prefix(bot, message):\r\n    if not message.guild:\r\n        prefixes = \"\"\r\n        return prefixes\r\n    else:\r\n        prefixes = settings[\"prefix\"]\r\n        return commands.when_mentioned_or(*prefixes)(bot, message)\r\n\r\nintents = discord.Intents(guilds=True, members=True, messages=True, reactions=True)\r\nallowed_mentions = discord.AllowedMentions(roles=False, users=False, everyone=False)\r\n\r\nif settings[\"ownership\"][\"multiple\"]:\r\n    bot = commands.Bot(command_prefix=get_prefix, case_insensitive=True, owner_ids=settings[\"ownership\"][\"owners\"],\r\n                       allowed_mentions=allowed_mentions, intents=intents)\r\nelse:\r\n    bot = commands.Bot(command_prefix=get_prefix, case_insensitive=True, owner_id=settings[\"ownership\"][\"owner\"],\r\n                       allowed_mentions=allowed_mentions, intents=intents)\r\n\r\nbot.db = db\r\nbot.remove_command(\"help\")\r\nbot.settings = settings\r\nbot.cmd_edits = {}\r\n\r\nif __name__ == \"__main__\":\r\n    for ext in botExtensions:\r\n        try:\r\n            bot.load_extension(ext)\r\n            logging.info(f\"{ext} has been loaded\")\r\n        except Exception as err:\r\n            logging.exception(f\"An error occurred whilst loading {ext}\", exc_info=err)\r\n\r\n\r\n@bot.event\r\nasync def on_ready():\r\n    logging.info(f\"Connection established! - Logged in as {bot.user} ({bot.user.id})\")\r\n    game = discord.Game(name=\"discordextremelist.xyz\", type=discord.ActivityType.watching)\r\n    await bot.change_presence(status=discord.Status.online, activity=game)\r\n    if not hasattr(bot, \"uptime\"):\r\n        bot.uptime = datetime.datetime.utcnow()\r\n\r\n\r\n@bot.event\r\nasync def on_guild_join(guild):\r\n    logging.info(f\"Joined guild - {guild.name} ({guild.id})\")\r\n\r\n\r\n@bot.event\r\nasync def on_user_update(_, after):\r\n    if after.bot:\r\n        db_bot = db[\"bots\"].find_one({\"_id\": str(after.id)})\r\n\r\n        if db_bot:\r\n            db[\"bots\"].update_one({\"_id\": str(after.id)}, {\r\n                \"$set\": {\r\n                    \"name\": after.name,\r\n                    \"avatar\": {\r\n                        \"hash\": after.avatar,\r\n                        \"url\": f\"https://cdn.discordapp.com/avatars/{after.id}/{after.avatar}\"  # ffs stay consistent\r\n                    }\r\n                }\r\n            })\r\n    else:\r\n        user = db[\"users\"].find_one({\"_id\": str(after.id)})\r\n\r\n        if user:\r\n            db[\"users\"].update_one({\"_id\": str(after.id)}, {\r\n                \"$set\": {\r\n                    \"name\": after.name,\r\n                    \"discrim\": after.discriminator,\r\n                    \"fullUsername\": f\"{after.name}#{after.discriminator}\",\r\n                    \"avatar\": {\r\n                        \"hash\": after.avatar,\r\n                        \"url\": f\"https://cdn.discordapp.com/avatars/{after.id}/{after.avatar}\"  # ffs\r\n                    }\r\n                }\r\n            })\r\n\r\n\r\n@bot.event\r\nasync def on_member_join(member):\r\n    if member.bot:\r\n        db_bot = await db.bots.find_one({\"_id\": str(member.id)})\r\n\r\n        if str(member.guild.id) == settings[\"guilds\"][\"main\"]:\r\n            if db_bot:\r\n                if db_bot[\"status\"][\"premium\"]:\r\n                    await member.add_roles(discord.Object(id=int(settings[\"roles\"][\"premiumBot\"])),\r\n                                           reason=\"Bot is Premium on the website.\")\r\n                else:\r\n                    await member.add_roles(discord.Object(id=int(settings[\"roles\"][\"bot\"])),\r\n                                           reason=\"Bot is Approved on the website.\")\r\n            else:\r\n                await member.add_roles(discord.Object(id=int(settings[\"roles\"][\"unlisted\"])),\r\n                                       reason=\"Bot is not listed on the website.\")\r\n        elif str(member.guild.id) == settings[\"guilds\"][\"staff\"]:\r\n            if db_bot:\r\n                if db_bot[\"status\"][\"approved\"]:\r\n                    await member.add_roles(discord.Object(id=int(settings[\"roles\"][\"unapprovedBot\"])),\r\n                                           reason=\"Bot is not approved on the website.\")\r\n        elif str(member.guild.id) == settings[\"guilds\"][\"bot\"]:\r\n            if db_bot:\r\n                if db_bot[\"status\"][\"approved\"]:\r\n                    await member.add_roles(discord.Object(id=int(settings[\"roles\"][\"botServer\"][\"listed\"])),\r\n                                           reason=\"Bot is already approved and listed on the website.\")\r\n    elif str(member.guild.id) == settings[\"guilds\"][\"main\"]:\r\n        db_bot = await db.bots.find_one({\"owner\": {\"id\": str(member.id)}})\r\n        if db_bot is not None and db_bot[\"status\"][\"approved\"]:\r\n            await member.add_roles(discord.Object(id=int(settings[\"roles\"][\"developer\"])),\r\n                                   reason=\"User is a Developer on the website.\")\r\n\r\n\r\n@bot.event\r\nasync def on_command_error(ctx, error):\r\n    if isinstance(error, (discord.Forbidden, commands.CommandNotFound)):\r\n        return\r\n\r\n    if isinstance(error, NoMod):\r\n        return await ctx.channel.send(f\"{settings['formats']['noPerms']} **Invalid permission(s):** You need \"\r\n                                      f\"to be a Moderator to execute this command.\")\r\n\r\n    if isinstance(error, NoSomething):\r\n        return await ctx.channel.send(settings['formats']['error'] + error.message)\r\n\r\n    if isinstance(error, commands.MissingRequiredArgument):\r\n        return await ctx.send(f\"{settings['formats']['error']} **Missing arguments:** Argument `{error.param.name}` \"\r\n                              f\"is required.\")\r\n\r\n    if isinstance(error, commands.CheckFailure) and error.args:\r\n        return await ctx.channel.send(error)\r\n\r\n    if isinstance(error, commands.CommandError) and error.args:\r\n        return await ctx.channel.send(error)\r\n\r\n    logging.exception(\"something done fucked up\", exc_info=error)\r\n\r\n\r\n@bot.event\r\nasync def on_message(msg):\r\n    if not msg.author.bot:\r\n        ctx = await bot.get_context(msg, cls=EditingContext)\r\n        await bot.invoke(ctx)\r\n\r\n        ticket = await bot.db.tickets.find_one({\r\n            \"ids.channel\": str(ctx.channel.id)\r\n        })\r\n\r\n        if ticket and ticket[\"status\"] == 0:\r\n            bot_db = await ctx.bot.db.bots.find_one({\r\n                \"_id\": str(ticket[\"ids\"][\"bot\"])\r\n            })\r\n\r\n            if bot_db and bot_db[\"owner\"][\"id\"] == str(ctx.author.id):\r\n                message = await ctx.channel.fetch_message(int(ticket[\"ids\"][\"message\"]))\r\n\r\n                embed = message.embeds[0]\r\n                embed.colour = 0x0fb9fc\r\n                embed.set_author(name=f\"Approval Feedback - {ticket['_id']} [DEV REPLIED]\",\r\n                                 icon_url=ctx.bot.settings[\"images\"][\"dev_replied\"])\r\n\r\n                await message.edit(embed=embed)\r\n\r\n                await ctx.send(f\"{bot.settings['formats']['ticketStatus']} **Ticket update:** Changed ticket \"\r\n                               f\"status to `Dev Replied`.\", mention_author=False)\r\n\r\n                ticket = await bot.db.tickets.find_one({\r\n                    \"ids.message\": str(message.id)\r\n                })\r\n\r\n                log_msg = await ctx.guild.get_channel(int(bot.settings[\"channels\"][\"ticketLog\"])) \\\r\n                    .fetch_message(int(ticket[\"ids\"][\"log\"]))\r\n\r\n                embed2 = log_msg.embeds[0]\r\n                embed2.colour = 0x0fb9fc\r\n                embed2.set_author(name=f\"Approval Feedback - {ticket['_id']} [DEV REPLIED]\",\r\n                                  icon_url=ctx.bot.settings[\"images\"][\"dev_replied\"])\r\n\r\n                await log_msg.edit(embed=embed2)\r\n\r\n                await ctx.bot.db.tickets.update_one({\"_id\": ticket[\"_id\"]}, {\r\n                    \"$set\": {\r\n                        \"status\": 3\r\n                    }\r\n                })\r\n\r\n\r\n@bot.event\r\nasync def on_message_edit(old_msg, new_msg):\r\n    if not old_msg.author.bot and new_msg.content != old_msg.content:\r\n        ctx = await bot.get_context(new_msg, cls=EditingContext)\r\n        await bot.invoke(ctx)\r\n\r\n\r\nbot.run(settings[\"token\"], bot=True, reconnect=True)\r\n"
  },
  {
    "path": "cogs/admin.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nimport datetime\n\nimport discord\nfrom discord.ext import commands\n\nfrom ext.checks import NoSomething\nfrom .types import userTypes, globalTypes\n\n\nclass AdminCog(commands.Cog, name=\"Admin\"):\n\n    def __init__(self, bot):\n        self.bot = bot\n        self.help_icon = f\"{self.bot.settings['emoji']['coder']}\"\n    \n    async def embed_colour(self, ctx):\n        global colour\n\n        bot_guild_member = await ctx.guild.fetch_member(ctx.bot.user.id)\n        if len(str(bot_guild_member.colour.value)) == 1:\n            colour = 0xFFFFFA\n        else:\n            colour = bot_guild_member.colour.value\n\n        return colour\n\n    @commands.command(name=\"admintoken\", usage=\"admintoken\",\n                      description=\"Allows you to get your temporary DELADMIN access token.\")\n    async def admin_token(self, ctx):\n        \"\"\"\n        Allows you to get your temporary DELADMIN access token.\n        \"\"\"\n        async with ctx.channel.typing():\n            db_user: userTypes.DelUser = await self.bot.db.users.find_one({\"_id\": str(ctx.author.id)})\n\n            if not db_user:\n                raise NoSomething(ctx.author)\n\n            token: globalTypes.DelAdminToken = await self.bot.db.adminTokens.find_one({\"_id\": str(ctx.author.id)})\n\n            if token:\n                embed = discord.Embed(colour=await self.embed_colour(ctx))\n\n                embed.add_field(name=f\"{self.bot.settings['emoji']['clock']} Valid From\",\n                                value=datetime.datetime.utcfromtimestamp(token[\"lastUpdate\"] / 1000).strftime(\n                                    f\"%I:%M%p - %a, %d %b %Y (GMT)\"))\n                embed.add_field(name=f\"{self.bot.settings['emoji']['timer']} Valid Until\",\n                                value=datetime.datetime.utcfromtimestamp(token[\"validUntil\"] / 1000).strftime(\n                                    f\"%I:%M%p - %a, %d %b %Y (GMT)\"))\n                embed.add_field(name=f\"{self.bot.settings['emoji']['cog']} Token\", value=f\"```{token['token']}```\",\n                                inline=False)\n                embed.set_thumbnail(url=ctx.author.avatar_url)\n\n                try:\n                    await ctx.author.send(embed=embed)\n                    await ctx.send(\n                        f\"{self.bot.settings['formats']['success']} Your current admin token has been dmed to you.\")\n                except:\n                    await ctx.send(\"Your dms appear to be closed\")\n            else:\n                await ctx.send(\n                    f\"{self.bot.settings['formats']['noPerms']} **Invalid permission(s):** You need to be a \"\n                    f\"DEL admin to obtain one of these.\")\n\n\ndef setup(bot):\n    bot.add_cog(AdminCog(bot))\n"
  },
  {
    "path": "cogs/help.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nimport json\n\nimport discord\nfrom discord.ext import commands\n\nfrom .types import userTypes\n\nwith open(\"settings.json\") as content:\n    settings = json.load(content)\n\n\nclass BotClass:\n    settings = settings\n\n\nclass HelpCommand(commands.HelpCommand):\n\n    def __init__(self, *args, **kwargs):\n        self.bot = BotClass\n        self.show_hidden = False\n        self.verify_checks = True\n\n        self.mod_cogs = [\"Tickets\", \"Notes\"]\n        self.admin_cogs = [\"Admin\", \"Jishaku\"]\n        self.jishaku_under_cog = \"Admin\"\n        self.ignore_cogs = [\"Events\"]\n\n        super().__init__(command_attrs={\n            \"help\": \"Shows the help about the bot and/or commands.\",\n            \"brief\": \"See cog/command help\",\n            \"usage\": \"[category / command]\",\n            \"name\": \"help\"\n        })\n\n    async def embed_colour(self, ctx):\n        global colour\n\n        bot_guild_member = await ctx.guild.fetch_member(ctx.bot.user.id)\n        if len(str(bot_guild_member.colour.value)) == 1:\n            colour = 0xFFFFFA\n        else:\n            colour = bot_guild_member.colour.value\n\n        return colour\n\n    def get_command_signature(self, command):\n        return command.qualified_name\n\n    async def command_callback(self, ctx, *, command=None):\n        \"\"\"|coro|\n        The actual implementation of the help command.\n        It is not recommended to override this method and instead change\n        the behaviour through the methods that actually get dispatched.\n        - :meth:`send_bot_help`\n        - :meth:`send_cog_help`\n        - :meth:`send_group_help`\n        - :meth:`send_command_help`\n        - :meth:`get_destination`\n        - :meth:`command_not_found`\n        - :meth:`subcommand_not_found`\n        - :meth:`send_error_message`\n        - :meth:`on_help_command_error`\n        - :meth:`prepare_help_command`\n        \"\"\"\n\n        await self.prepare_help_command(ctx, command)\n\n        if command is None:\n            mapping = self.get_bot_mapping()\n            return await self.send_bot_help(mapping)\n\n        # Check if it's a cog\n        cog = ctx.bot.get_cog(command.title())\n        if command.title().lower() != \"jishaku\":\n            if cog is not None:\n                return await self.send_cog_help(cog)\n        else:\n            return await self.send_group_help(ctx.bot.get_command(\"jishaku\"))\n\n        maybe_coro = discord.utils.maybe_coroutine\n\n        # If it's not a cog then it's a command.\n        # Since we want to have detailed errors when someone\n        # passes an invalid subcommand, we need to walk through\n        # the command group chain ourselves.\n        keys = command.split(' ')\n        cmd = ctx.bot.all_commands.get(keys[0])\n        if cmd is None:\n            string = await maybe_coro(self.command_not_found, self.remove_mentions(keys[0]))\n            return await self.send_error_message(string)\n\n        for key in keys[1:]:\n            try:\n                found = cmd.all_commands.get(key)\n            except AttributeError:\n                string = await maybe_coro(self.subcommand_not_found, cmd, self.remove_mentions(key))\n                return await self.send_error_message(string)\n            else:\n                if found is None:\n                    string = await maybe_coro(self.subcommand_not_found, cmd, self.remove_mentions(key))\n                    return await self.send_error_message(string)\n                cmd = found\n\n        if isinstance(cmd, commands.Group):\n            return await self.send_group_help(cmd)\n        else:\n            return await self.send_command_help(cmd)\n\n    async def send_bot_help(self, mapping):\n        \"\"\"\n        Sends bot help.\n        \"\"\"\n\n        embed = discord.Embed(color=await self.embed_colour(self.context))\n        embed.title = f\"{self.context.bot.settings['emoji']['home']} Help: Menu\"\n        embed.description = f\"All commands use the prefix `{self.bot.settings['prefix'][0]}` or \" \\\n                            f\"`@{str(self.context.bot.user)}`.\"\n\n        for extension in self.context.bot.cogs.values():\n            if extension.qualified_name in self.ignore_cogs or extension.qualified_name == \"Jishaku\":\n                continue\n\n            db_user: userTypes.DelUser = await self.context.bot.db.users.find_one({\"_id\": str(self.context.author.id)})\n\n            if db_user:\n                if extension.qualified_name in self.mod_cogs and not db_user[\"rank\"][\"mod\"]:\n                    continue\n\n                if extension.qualified_name in self.admin_cogs and not db_user[\"rank\"][\"admin\"]:\n                    continue\n            else:\n                if extension.qualified_name in self.mod_cogs or extension.qualified_name in self.admin_cogs:\n                    continue\n\n            extension_commands = \"\"\n\n            for command in set(extension.get_commands()):\n                if not command.hidden:\n                    mod = False\n                    for check in command.checks:\n                        if check.__qualname__.startswith(\"mod_check\"):\n                            mod = True\n\n                    if mod and db_user:\n                        if db_user[\"rank\"][\"mod\"]:\n                            if len(extension_commands) == 0:\n                                extension_commands += f\"`{command.qualified_name}`\"\n                            else:\n                                extension_commands += f\", `{command.qualified_name}`\"\n                        else:\n                            continue\n                    elif mod and not db_user:\n                        continue\n                    else:\n                        if len(extension_commands) == 0:\n                            extension_commands += f\"`{command.qualified_name}`\"\n                        else:\n                            extension_commands += f\", `{command.qualified_name}`\"\n                else:\n                    continue\n\n            if extension.qualified_name == self.jishaku_under_cog:\n                jsk_extension = self.context.bot.get_cog(\"Jishaku\")\n                if not jsk_extension.jsk.hidden:\n                    extension_commands += \", `jishaku`\"\n\n            embed.add_field(name=f\"{extension.help_icon} {extension.qualified_name}\", value=extension_commands,\n                            inline=False)\n\n        await self.context.send(embed=embed)\n\n    async def send_command_help(self, command):\n        \"\"\"\n        Sends help for a specific command.\n        \"\"\"\n\n        db_user: userTypes.DelUser = await self.context.bot.db.users.find_one({\"_id\": str(self.context.author.id)})\n\n        if db_user:\n            if command.cog_name in self.ignore_cogs:\n                return await self.send_error_message(self.command_not_found(command.name))\n\n            if command.cog_name in self.mod_cogs and not db_user[\"rank\"][\"mod\"]:\n                return await self.send_error_message(self.command_not_found(command.name))\n\n            if self.context.bot.settings[\"ownership\"][\"multiple\"]:\n                if command.cog_name in self.admin_cogs and self.context.author.id not in \\\n                        self.bot.settings[\"ownership\"][\"owners\"]:\n                    return await self.send_error_message(self.command_not_found(command.name))\n            else:\n                if command.cog_name in self.admin_cogs and self.context.author.id != \\\n                        self.bot.settings[\"ownership\"][\"owner\"]:\n                    return await self.send_error_message(self.command_not_found(command.name))\n\n            if command.hidden:\n                return await self.send_error_message(self.command_not_found(command.name))\n        else:\n            pass\n\n        aliases = '`' + '`, `'.join(command.aliases) + \"`\"\n\n        if aliases == \"``\" or aliases == '`':\n            aliases = \"No aliases were found.\"\n\n        if command.help:\n            description = str(command.help)\n        else:\n            description = \"No description provided.\"\n\n        command.help_icon = self.bot.settings[\"emoji\"][\"info\"]\n        command.help_name = command.qualified_name\n\n        embed = discord.Embed(description=description, colour=await self.embed_colour(self.context))\n        embed.title = f\"{command.help_icon} Help: {command.help_name}\"\n        embed.add_field(name=\"Usage\", value=f\"{self.clean_prefix}{command.signature}\")\n        embed.add_field(name=\"Aliases\", value=aliases)\n\n        await self.context.send(embed=embed)\n\n    async def send_group_help(self, group):\n        \"\"\"\n        Sends help for a specific group.\n        \"\"\"\n\n        db_user: userTypes.DelUser = await self.context.bot.db.users.find_one({\"_id\": str(self.context.author.id)})\n\n        if db_user:\n            if group.cog_name in self.ignore_cogs:\n                return await self.send_error_message(self.command_not_found(group.name))\n\n            if group.cog_name in self.mod_cogs and not db_user[\"rank\"][\"mod\"]:\n                return await self.context.channel.send(f\"{self.bot.settings['formats']['noPerms']} **Invalid \"\n                                                       f\"permission(s):** The specified command requires you to have \"\n                                                       f\"Moderator permissions to access.\")\n\n            if self.context.bot.settings[\"ownership\"][\"multiple\"]:\n                if group.cog_name in self.admin_cogs and self.context.author.id not in \\\n                        self.bot.settings[\"ownership\"][\"owners\"] and not db_user[\"rank\"][\"admin\"]:\n                    return await self.context.channel.send(f\"{self.bot.settings['formats']['noPerms']} **Invalid \"\n                                                           f\"permission(s):** The specified command requires you to \"\n                                                           f\"have Administrator permissions to access.\")\n            else:\n                if group.cog_name in self.admin_cogs and self.context.author.id != \\\n                        self.bot.settings[\"ownership\"][\"owner\"] and not db_user[\"rank\"][\"admin\"]:\n                    return await self.context.channel.send(f\"{self.bot.settings['formats']['noPerms']} **Invalid \"\n                                                           f\"permission(s):** The specified command requires you to \"\n                                                           f\"have Administrator permissions to access.\")\n\n            if group.hidden:\n                return await self.send_error_message(self.command_not_found(group.name))\n        else:\n            pass\n\n        sub_commands = \"\"\n\n        for group_command in group.commands:\n            sub_commands += '`' + group_command.name + f'`, '\n\n        aliases = \"`\" + '`, `'.join(group_command.root_parent.aliases) + '`'\n\n        if aliases == \"``\":\n            aliases = \"No aliases were found.\"\n\n        if group_command.root_parent == self.context.bot.get_command(\"jishaku\"):\n            cmd_signature = \"jishaku [subCommand]\"\n        else:\n            cmd_signature = group_command.root_parent\n\n        if group_command.root_parent.help:\n            description = str(group_command.root_parent.help)\n        else:\n            description = \"No help provided.\"\n\n        group.help_icon = self.bot.settings[\"emoji\"][\"info\"]\n        group.help_name = self.get_command_signature(group_command.root_parent)\n\n        if group.cog_name.lower() == \"jishaku\":\n            group.help_icon = self.bot.settings[\"emoji\"][\"coder\"]\n            group.help_name = \"Jishaku\"\n\n        embed = discord.Embed(description=description, colour=await self.embed_colour(self.context))\n        embed.title = f\"{group.help_icon} Help: {group.help_name}\"\n        embed.add_field(name=\"Usage\", value=f\"{self.clean_prefix}{cmd_signature}\")\n        embed.add_field(name=\"Aliases\", value=aliases)\n        embed.add_field(name=f\"Subcommands ({len(group.commands)})\", value=sub_commands[:-2], inline=False)\n\n        await self.context.send(embed=embed)\n\n    async def send_cog_help(self, cog):\n        \"\"\"\n        Sends help for a specific cog.\n        \"\"\"\n\n        db_user: userTypes.DelUser = await self.context.bot.db.users.find_one({\"_id\": str(self.context.author.id)})\n\n        if db_user:\n            if cog.qualified_name in self.ignore_cogs:\n                return await self.send_error_message(self.command_not_found(cog.qualified_name))\n\n            if cog.qualified_name in self.mod_cogs and not db_user[\"rank\"][\"mod\"]:\n                return await self.context.channel.send(f\"{self.bot.settings['formats']['noPerms']} **Invalid \"\n                                                       f\"permission(s):** The specified cog requires you to have \"\n                                                       f\"Moderator permissions to access.\")\n\n            if self.context.bot.settings[\"ownership\"][\"multiple\"]:\n                if cog.qualified_name in self.admin_cogs and self.context.author.id not in \\\n                        self.bot.settings[\"ownership\"][\"owners\"] and not db_user[\"rank\"][\"admin\"]:\n                    return await self.context.channel.send(f\"{self.bot.settings['formats']['noPerms']} **Invalid \"\n                                                           f\"permission(s):** The specified cog requires you to have \"\n                                                           f\"Administrator permissions to access.\")\n            else:\n                if cog.qualified_name in self.admin_cogs and self.context.author.id != \\\n                        self.bot.settings[\"ownership\"][\"owner\"] and not db_user[\"rank\"][\"admin\"]:\n                    return await self.context.channel.send(f\"{self.bot.settings['formats']['noPerms']} **Invalid \"\n                                                           f\"permission(s):** The specified cog requires you to have \"\n                                                           f\"Administrator permissions to access.\")\n        else:\n            pass\n\n        cog_commands = \"\"\n        for command in cog.get_commands():\n            if command.hidden:\n                continue\n            if command.description is None:\n                brief = \"No information.\"\n            else:\n                brief = command.description\n\n            cog_commands += f\"`{command.qualified_name}` - {brief}\\n\"\n\n        if cog.qualified_name == \"Jishaku\":\n            cog.help_icon = self.bot.settings[\"emoji\"][\"coder\"]\n            cog_commands += f\"*For information on the command type:* `{self.bot.settings['prefix'][0]}help jsk`.\"\n        elif cog.qualified_name == self.jishaku_under_cog:\n            jsk_extension = self.context.bot.get_cog(\"Jishaku\")\n            if not jsk_extension.jsk.hidden:\n                cog_commands += \"`jishaku` - The Jishaku debug and diagnostic commands.\"\n\n        embed = discord.Embed(description=cog_commands, colour=await self.embed_colour(self.context))\n        embed.title = f\"{cog.help_icon} Help: {cog.qualified_name} ({len(cog.get_commands())})\"\n\n        await self.context.send(embed=embed)\n\n    def command_not_found(self, string):\n        return f\"{self.bot.settings['formats']['error']} **Not found:** No command or cog called \" \\\n               f\"**\\\"**{discord.utils.escape_markdown(string, as_needed=False)}**\\\"** found.\"\n\n\ndef setup(bot):\n    bot.help_command = HelpCommand()\n"
  },
  {
    "path": "cogs/notes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nimport datetime\nimport time\n\nimport discord\nfrom discord.ext import commands\n\nfrom cogs.types import botTypes\nfrom ext.checks import mod_check, NoSomething\n\nimport typing\n\n\ndef check_s_end(string):\n    if string.endswith(\"s\"):\n        return True\n    else:\n        return False\n\n\nclass BotNotesCog(commands.Cog, name=\"Notes\"):\n\n    def __init__(self, bot):\n        self.bot = bot\n        self.help_icon = f\"{self.bot.settings['emoji']['notepad']}\"\n\n    async def embed_colour(self, ctx):\n        \"\"\"\n        Gets the bots display colour and returns a colour code able to be used on embeds.\n        \"\"\"\n        global colour\n\n        bot_guild_member = await ctx.guild.fetch_member(self.bot.user.id)\n        if len(str(bot_guild_member.colour.value)) == 1:\n            colour = 0xFFFFFA\n        else:\n            colour = bot_guild_member.colour.value\n\n        return colour\n\n    async def check_bot(self, ctx, bot: typing.Union[discord.User, str]):\n        \"\"\"\n        Runs the inputted string or discord.User object through various tests to determine if it is a\n        Discord bot in the site database, and a valid user, etc.\n        \"\"\"\n        if isinstance(bot, discord.User):\n            pass\n        elif isinstance(bot, str):\n            if bot.isdigit():\n                try:\n                    bot = await ctx.bot.fetch_user(bot)\n                except Exception as e:\n                    return await ctx.send(\n                        f\"{self.bot.settings['formats']['error']} **An error occurred:**\\n```py\\n{e}```\")\n            elif not bot.isdigit():\n                return await ctx.send(\n                    f\"{self.bot.settings['formats']['error']} **Unknown bot:** We could not find a bot with the \"\n                    f\"arguments you provided - Try using an ID so I can fetch it?\")\n\n        if not bot.bot:\n            return await ctx.send(f\"{self.bot.settings['formats']['error']} **Invalid bot:** {bot} is not a bot.\")\n\n        return bot\n\n    @commands.command(name=\"add-note\", aliases=[\"addnote\", \"insertnote\"], usage=\"add-note <bot> <note>\",\n                      description=\"Allows moderators to add a note to a bot in the site database.\")\n    @commands.guild_only()\n    @mod_check()\n    async def add_note(self, ctx, bot: typing.Union[discord.User, str], *, note: str):\n        \"\"\"\n        Allows moderators to add a note to a bot in the site database.\n        \"\"\"\n        bot = await self.check_bot(ctx, bot)\n\n        bot_db: botTypes.DelBot = await ctx.bot.db.bots.find_one({\n            \"_id\": str(bot.id)\n        })\n\n        if not bot_db:\n            raise NoSomething(bot)\n\n        notes_db = bot_db[\"reviewNotes\"]\n\n        notes_db.append({\n            \"note\": note,\n            \"author\": str(ctx.author.id),\n            \"date\": time.time() * 1000\n        })\n\n        await ctx.bot.db.bots.update_one({\"_id\": str(bot_db[\"_id\"])}, {\n            \"$set\": {\n                \"reviewNotes\": notes_db\n            }\n        })\n\n        return await ctx.send(f\"{self.bot.settings['formats']['success']} **Success:** I have successfully added your \"\n                              f\"note to {bot_db['name']}.\")\n\n    @commands.command(name=\"remove-note\", aliases=[\"removenote\", \"delnote\", \"del-note\", \"delete-note\", \"deletenote\"],\n                      usage=\"remove-note <bot> <note>\", description=\"Allows moderators to remove a note from a bot.\")\n    @commands.guild_only()\n    @mod_check()\n    async def remove_note(self, ctx, bot: typing.Union[discord.User, str], *, note: int):\n        \"\"\"\n        Allows moderators to remove a note from a bot.\n        \"\"\"\n        bot = await self.check_bot(ctx, bot)\n\n        bot_db: botTypes.DelBot = await ctx.bot.db.bots.find_one({\n            \"_id\": str(bot.id)\n        })\n\n        if not bot_db:\n            raise NoSomething(bot)\n\n        notes_db = bot_db[\"reviewNotes\"]\n\n        if note > len(notes_db) or note < 1:\n            return await ctx.send(f\"{self.bot.settings['formats']['error']} **Doesn't exist:** The note you're trying \"\n                                  f\"to delete doesn't exist.\")\n\n        del notes_db[(note - 1)]\n\n        await ctx.bot.db.bots.update_one({\"_id\": str(bot_db[\"_id\"])}, {\n            \"$set\": {\n                \"reviewNotes\": notes_db\n            }\n        })\n\n        return await ctx.send(\n            f\"{self.bot.settings['formats']['success']} **Success:** I have successfully removed note #{note} \"\n            f\"from {bot_db['name']}.\")\n\n    @commands.command(name=\"notes\", usage=\"notes <bot>\", description=\"Allows moderators to view all of a bots notes.\")\n    @commands.guild_only()\n    @mod_check()\n    async def notes(self, ctx, *, bot: typing.Union[discord.User, str]):\n        \"\"\"\n        Allows moderators to view all of a bots notes.\n        \"\"\"\n        bot = await self.check_bot(ctx, bot)\n\n        bot_db: botTypes.DelBot = await ctx.bot.db.bots.find_one({\n            \"_id\": str(bot.id)\n        })\n\n        if not bot_db:\n            raise NoSomething(bot)\n\n        if not bot_db[\"reviewNotes\"]:\n            return await ctx.send(f\"{self.bot.settings['formats']['info']} **No notes:** This bot does not have \"\n                                  f\"any notes.\")\n\n        if check_s_end(bot_db[\"name\"]):\n            title = f\"{bot_db['name']}' Notes\"\n        else:\n            title = f\"{bot_db['name']}'s Notes\"\n\n        embed = discord.Embed(title=title, colour=await self.embed_colour(ctx))\n        embed.set_thumbnail(url=bot.avatar_url if not bot_db.get(\"avatar\") else bot_db[\"avatar\"][\"url\"])\n        pos = 1\n\n        for note in bot_db[\"reviewNotes\"]:\n            try:\n                user = str(await self.bot.fetch_user(note[\"author\"]))\n            except discord.NotFound:\n                user = str(note[\"author\"])\n\n            date = datetime.datetime.utcfromtimestamp(note[\"date\"] / 1000).strftime(f\"%I:%M%p - %a, %d %b %Y (GMT)\")\n            embed.add_field(name=f\"Note #{pos}\", value=f\"-> **{discord.utils.escape_markdown(user, as_needed=False)} \"\n                                                       f\"- {date}**\\n\" + note[\"note\"], inline=False)\n            pos += 1\n\n        await ctx.send(embed=embed)\n\n\ndef setup(bot):\n    bot.add_cog(BotNotesCog(bot))\n"
  },
  {
    "path": "cogs/tags.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nimport asyncio\nimport time\nfrom typing import List, Union, Optional\nfrom io import BytesIO\n\nimport discord\nfrom discord.ext import commands\n\nfrom ext.checks import mod_check\n\nfrom .types import tagTypes\n\n\nclass TagsCog(commands.Cog, name=\"Tags\"):\n\n    def __init__(self, bot):\n        self.bot = bot\n        self.help_icon = f\"{self.bot.settings['emoji']['label']}\"\n\n    async def embed_colour(self, ctx):\n        \"\"\"\n        Gets the bots display colour and returns a colour code able to be used on embeds.\n        \"\"\"\n        global colour\n\n        bot_guild_member = await ctx.guild.fetch_member(self.bot.user.id)\n        if len(str(bot_guild_member.colour.value)) == 1:\n            colour = 0xFFFFFA\n        else:\n            colour = bot_guild_member.colour.value\n\n        return colour\n\n    async def tag_name_exists(self, name: str) -> Union[List[bool], Optional[tagTypes.DelTag]]:\n        \"\"\"\n        Checks if a tag name or alias matching the name specified exists in the database.\n        Returns a boolean stating whether the tag exists in an array in position 0.\n        If boolean in pos 0 is True, pos 1 will contain the tag.\n        \"\"\"\n        all_tags = self.bot.db.tags.find()\n        async for tag in all_tags:\n            if tag[\"_id\"] == name.lower():\n                return [True, tag]\n\n            if tag[\"aliases\"] is not None and len(tag[\"aliases\"]) > 0:\n                for alias in tag[\"aliases\"]:\n                    if alias == name.lower():\n                        return [True, tag]\n\n        return [False]\n\n    async def tag_exists_error(self, ctx, name):\n        \"\"\"\n        Sends an error message stating that there is a tag name/alias conflict.\n        \"\"\"\n        return await ctx.send(f\"{self.bot.settings['formats']['error']} **Name conflict:** A tag or tag alias with \"\n                              f\"the name **\\\"**{discord.utils.escape_markdown(name, as_needed=False)}**\\\"** already\"\n                              f\" exists.\")\n\n    async def tag_nf_error(self, ctx, name):\n        \"\"\"\n        Sends an error message stating that the specified tag does not exist.\n        \"\"\"\n        return await ctx.send(f\"{self.bot.settings['formats']['error']} **Not found:** A tag with the name of \"\n                              f\"**\\\"**{discord.utils.escape_markdown(name, as_needed=False)}**\\\"** was not found.\")\n\n    @commands.command(name=\"create-tag\", aliases=[\"newtag\", \"new-tag\", \"add-tag\", \"addtag\"],\n                      usage=\"create-tag <tag> <content>\", description=\"Allows moderators to create a tag.\")\n    @commands.guild_only()\n    @mod_check()\n    async def create_tag(self, ctx, name: str, *, tag: str):\n        \"\"\"\n        Allows moderators to create a tag.\n        \"\"\"\n        tag_name_exists = await self.tag_name_exists(name)\n        if tag_name_exists[0]:\n            return await self.tag_exists_error(ctx, name)\n\n        try:\n            def check(r, u):\n                return r.message.id == language_picker.id and u.id != ctx.bot.user.id\n\n            language_picker = await ctx.send(\"Which language are you creating this tag in?\")\n            await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"britian\"])\n            await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"])\n            await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"france\"])\n            await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"])\n            await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"spain\"])\n\n            responded = False\n            languages = []\n            languages_dict = self.bot.settings[\"emoji\"][\"flags\"]\n\n            for language in languages_dict:\n                languages.append(languages_dict[language])\n\n            while not responded:\n                reaction, user = await self.bot.wait_for(\"reaction_add\", check=check, timeout=30.0)\n\n                if user.id != ctx.author.id:\n                    await language_picker.remove_reaction(reaction, user)\n                elif str(reaction) not in languages:\n                    await language_picker.remove_reaction(reaction, user)\n                elif user.id == ctx.author.id:\n                    await language_picker.clear_reactions()\n\n                    contents = {\n                        \"en\": \"\",\n                        \"tr\": \"\",\n                        \"fr\": \"\",\n                        \"pt\": \"\",\n                        \"es\": \"\"\n                    }\n\n                    reaction_name = \"\"\n                    if str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"britian\"]:\n                        contents[\"en\"] = tag\n                        reaction_name = \"English\"\n                    elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"]:\n                        contents[\"tr\"] = tag\n                        reaction_name = \"Turkish\"\n                    elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"france\"]:\n                        contents[\"fr\"] = tag\n                        reaction_name = \"French\"\n                    elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"]:\n                        contents[\"pt\"] = tag\n                        reaction_name = \"Portuguese\"\n                    elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"spain\"]:\n                        contents[\"es\"] = tag\n                        reaction_name = \"Spanish\"\n\n                    await self.bot.db.tags.insert_one({\n                        \"_id\": name.lower(),\n                        \"creator\": str(ctx.author.id),\n                        \"creationDate\": 0,\n                        \"contents\": contents,\n                        \"aliases\": []\n                    })\n\n                    return await ctx.channel.send(f\"{self.bot.settings['formats']['success']} **Tag created:** A tag \"\n                                                  f\"with the name of \"\n                                                  f\"**\\\"**{discord.utils.escape_markdown(name, as_needed=False)}**\\\"**,\"\n                                                  f\" in the language {reaction} **{reaction_name}** was successfully \"\n                                                  f\"created.\")\n        except asyncio.TimeoutError:\n            return\n\n    @commands.command(name=\"edit-tag\", aliases=[\"modify-tag\", \"update-tag\", \"change-tag\", \"edittag\"],\n                      usage=\"edit-tag <tag> <content>\", description=\"Allows moderators to edit a tag.\")\n    @commands.guild_only()\n    @mod_check()\n    async def edit_tag(self, ctx, name: str, *, content: str):\n        \"\"\"\n        Allows moderators to edit a tag.\n        \"\"\"\n        tag = await self.tag_name_exists(name)\n        if tag[0]:\n            try:\n                def check(r, u):\n                    return r.message.id == language_picker.id and u.id != ctx.bot.user.id\n\n                language_picker = await ctx.send(\"Which language of this tag are you editing/adding?\")\n                await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"britian\"])\n                await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"])\n                await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"france\"])\n                await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"])\n                await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"spain\"])\n\n                responded = False\n                languages = []\n                languages_dict = self.bot.settings[\"emoji\"][\"flags\"]\n\n                for language in languages_dict:\n                    languages.append(languages_dict[language])\n\n                while not responded:\n                    reaction, user = await self.bot.wait_for(\"reaction_add\", check=check, timeout=30.0)\n\n                    if user.id != ctx.author.id:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif str(reaction) not in languages:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif user.id == ctx.author.id:\n                        await language_picker.clear_reactions()\n\n                        contents = {\n                            \"en\": tag[1][\"contents\"][\"en\"],\n                            \"tr\": tag[1][\"contents\"][\"tr\"],\n                            \"fr\": tag[1][\"contents\"][\"fr\"],\n                            \"pt\": tag[1][\"contents\"][\"pt\"],\n                            \"es\": tag[1][\"contents\"][\"es\"]\n                        }\n\n                        contents_backup = \\\n                            discord.File(BytesIO((str(contents)).encode(\"utf-8\")),\n                                         filename=f\"{tag[1]['_id']}-{time.time()}.json\")\n\n                        reaction_name = \"\"\n                        if str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"britian\"]:\n                            contents[\"en\"] = content\n                            reaction_name = \"English\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"]:\n                            contents[\"tr\"] = content\n                            reaction_name = \"Turkish\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"france\"]:\n                            contents[\"fr\"] = content\n                            reaction_name = \"French\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"]:\n                            contents[\"pt\"] = content\n                            reaction_name = \"Portuguese\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"spain\"]:\n                            contents[\"es\"] = content\n                            reaction_name = \"Spanish\"\n\n                        await ctx.bot.db.tags.update_one({\"_id\": tag[1][\"_id\"]}, {\n                            \"$set\": {\n                                \"contents\": contents\n                            }\n                        })\n\n                        await ctx.author.send(content=f\"Here's a backup of the tag \"\n                                                      f\"**\\\"**{discord.utils.escape_markdown(name, as_needed=False)}\"\n                                                      f\"**\\\"** which you just edited, before your edits were made. \"\n                                                      f\"Just in case!\",\n                                              file=contents_backup)\n\n                        return await ctx.channel.send(f\"{self.bot.settings['formats']['success']} **Tag edited:** A tag\"\n                                                      f\" with the name of \"\n                                                      f\"**\\\"**{discord.utils.escape_markdown(name, as_needed=False)}**\"\n                                                      f\"\\\"**, in the language {reaction} **{reaction_name}** was \"\n                                                      f\"successfully edited.\")\n            except asyncio.TimeoutError:\n                return\n        else:\n            return await self.tag_nf_error(ctx, name)\n\n    @commands.command(name=\"tag-aliases\", aliases=[\"alias-tag\"], usage=\"tag-aliases <name/alias>\",\n                      description=\"Allows users to view a tag's aliases.\")\n    @commands.guild_only()\n    async def tag_aliases(self, ctx, *, name: str):\n        tag = await self.tag_name_exists(name)\n        if tag[0]:\n            if len(tag[1][\"aliases\"]) > 0:\n                return await ctx.send(f\"{self.bot.settings['formats']['info']} **Aliases:** This tag has the following \"\n                                      f\"aliases - {'`' + '`, `'.join(tag[1]['aliases']) + '`'}.\")\n            else:\n                return await ctx.send(f\"{self.bot.settings['formats']['info']} **Aliases:** This tag has no aliases.\")\n        else:\n            return await self.tag_nf_error(ctx, name)\n\n    @commands.command(name=\"add-tag-alias\", usage=\"add-tag-alias <name> <alias>\", description=\"Allows moderators to add\"\n                                                                                              \" an alias for a tag.\")\n    @commands.guild_only()\n    @mod_check()\n    async def add_tag_aliases(self, ctx, name: str, *, alias: str):\n        \"\"\"\n        Allows moderators to add an alias for a tag.\n        \"\"\"\n        exists = await self.tag_name_exists(alias)\n        tag = await self.tag_name_exists(name)\n\n        if not exists[0] and tag[0]:\n            if len(alias) > 20:\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Too longth:** The alias name you \"\n                                      f\"inputted is too long.\")\n            elif len(alias) < 2:\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Too longth:** The alias name you \"\n                                      f\"inputted is too short.\")\n\n            aliases = tag[1][\"aliases\"]\n            aliases.append(alias.lower())\n            await ctx.bot.db.tags.update_one({\"_id\": tag[1][\"_id\"]}, {\n                \"$set\": {\n                    \"aliases\": aliases\n                }\n            })\n\n            return await ctx.send(f\"{self.bot.settings['formats']['success']} **Added alias:** The alias was \"\n                                  f\"successfully added.\")\n        else:\n            if exists[0]:\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Duplicated alias:** This tag already \"\n                                      f\"has this alias.\")\n            else:\n                return await self.tag_nf_error(ctx, name)\n\n    @commands.command(name=\"remove-tag-alias\", usage=\"remove-tag-alias <name> <alias>\",\n                      aliases=[\"del-tag-alias\", \"rm-tag-alias\"], description=\"Allows moderators to remove an alias for \"\n                                                                             \"a tag.\")\n    @commands.guild_only()\n    @mod_check()\n    async def remove_tag_alias(self, ctx, name: str, *, alias: str):\n        \"\"\"\n        Allows moderators to remove an alias for a tag.\n        \"\"\"\n        tag = await self.tag_name_exists(name)\n\n        if tag[0]:\n            if alias.lower() in tag[1][\"aliases\"]:\n\n                aliases = tag[1][\"aliases\"]\n                aliases.remove(alias.lower())\n                await ctx.bot.db.tags.update_one({\"_id\": tag[1][\"_id\"]}, {\n                    \"$set\": {\n                        \"aliases\": aliases\n                    }\n                })\n\n                return await ctx.send(f\"{self.bot.settings['formats']['success']} **Removed alias:** The alias was \"\n                                      f\"successfully removed.\")\n            else:\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Not found:** The specified alias \"\n                                      f\"does not belong to the specified tag.\")\n        else:\n            return await self.tag_nf_error(ctx, name)\n\n    @commands.command(name=\"tags\", usage=\"tags\", aliases=[\"list-tags\", \"tag-list\", \"list-tag\"],\n                      description=\"Shows all of the saved tags.\")\n    @commands.guild_only()\n    async def tags(self, ctx):\n        \"\"\"\n        Shows all of the saved tags.\n        \"\"\"\n        all_tags = self.bot.db.tags.find()\n        tags = \"\"\n        async for tag in all_tags:\n            tags += \"`\" + tag[\"_id\"] + f\"`, \"\n\n        if len(tags) > 0:\n            await ctx.send(f\"{self.bot.settings['formats']['info']} **Tags:** A full list of tags is available below:\"\n                           f\"\\n\\n{tags[:-2]}\")\n        else:\n            await ctx.send(f\"{self.bot.settings['formats']['info']} **Tags:** There are no saved tags.\")\n\n    @commands.command(name=\"raw-tag\", usage=\"raw-tag <name/alias>\", aliases=[\"tag-raw\", \"txt-tag\"],\n                      description=\"Allows moderators to get the content of a specific language of a tag in a raw file.\")\n    @commands.guild_only()\n    @mod_check()\n    async def raw_tag(self, ctx, *, name: str):\n        \"\"\"\n        Allows moderators to get the content of a specific language of a tag in a raw file.\n        \"\"\"\n        tag = await self.tag_name_exists(name)\n\n        if tag[0]:\n            try:\n                def check(r, u):\n                    return r.message.id == language_picker.id and u.id != ctx.bot.user.id\n\n                language_picker = await ctx.send(\"Which language do you want to get the raw text in for this tag?\")\n                if len(tag[1][\"contents\"][\"en\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"britian\"])\n                if len(tag[1][\"contents\"][\"tr\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"])\n                if len(tag[1][\"contents\"][\"fr\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"france\"])\n                if len(tag[1][\"contents\"][\"pt\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"])\n                if len(tag[1][\"contents\"][\"es\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"spain\"])\n\n                responded = False\n                languages = []\n                languages_dict = self.bot.settings[\"emoji\"][\"flags\"]\n\n                for language in languages_dict:\n                    languages.append(languages_dict[language])\n\n                while not responded:\n                    reaction, user = await self.bot.wait_for(\"reaction_add\", check=check, timeout=30.0)\n\n                    if user.id != ctx.author.id:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif str(reaction) not in languages:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif user.id == ctx.author.id:\n                        await language_picker.clear_reactions()\n\n                        locale = \"\"\n                        if str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"britian\"]:\n                            locale = \"en\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"]:\n                            locale = \"tr\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"france\"]:\n                            locale = \"fr\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"]:\n                            locale = \"pt\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"spain\"]:\n                            locale = \"es\"\n\n                        raw_tag = discord.File(BytesIO((str(tag[1][\"contents\"][locale])).encode(\"utf-8\")),\n                                               filename=f\"{tag[1]['_id']}-{time.time()}.txt\")\n                        return await ctx.send(file=raw_tag)\n\n            except asyncio.TimeoutError:\n                return\n        else:\n            return await self.tag_nf_error(ctx, name)\n\n    @commands.command(name=\"tag\", aliases=[\"show-tag\", \"view-tag\"], usage=\"tag <name/alias>\",\n                      description=\"Allows users to view a tag.\")\n    @commands.guild_only()\n    async def tag(self, ctx, *, name: str):\n        \"\"\"\n        Allows users to view a tag.\n        \"\"\"\n        tag = await self.tag_name_exists(name)\n        if tag[0]:\n            try:\n                def check(r, u):\n                    return r.message.id == language_picker.id and u.id != ctx.bot.user.id\n\n                language_picker = await ctx.send(\"Which language do you want to view this tag in?\")\n                if len(tag[1][\"contents\"][\"en\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"britian\"])\n                if len(tag[1][\"contents\"][\"tr\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"])\n                if len(tag[1][\"contents\"][\"fr\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"france\"])\n                if len(tag[1][\"contents\"][\"pt\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"])\n                if len(tag[1][\"contents\"][\"es\"]) > 0:\n                    await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"flags\"][\"spain\"])\n\n                responded = False\n                languages = []\n                languages_dict = self.bot.settings[\"emoji\"][\"flags\"]\n\n                for language in languages_dict:\n                    languages.append(languages_dict[language])\n\n                while not responded:\n                    reaction, user = await self.bot.wait_for(\"reaction_add\", check=check, timeout=30.0)\n\n                    if user.id != ctx.author.id:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif str(reaction) not in languages:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif user.id == ctx.author.id:\n                        await language_picker.clear_reactions()\n\n                        locale = \"\"\n                        if str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"britian\"]:\n                            locale = \"en\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"turkey\"]:\n                            locale = \"tr\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"france\"]:\n                            locale = \"fr\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"portugal\"]:\n                            locale = \"pt\"\n                        elif str(reaction) == self.bot.settings[\"emoji\"][\"flags\"][\"spain\"]:\n                            locale = \"es\"\n\n                        return await ctx.send(tag[1][\"contents\"][locale])\n\n            except asyncio.TimeoutError:\n                return\n        else:\n            return await self.tag_nf_error(ctx, name)\n\n    @commands.command(name=\"delete-tag\", usage=\"delete-tag <name/alias>\",\n                      aliases=[\"remove-tag\", \"del-tag\"], description=\"Allows moderators to delete a tag.\")\n    @commands.guild_only()\n    @commands.cooldown(1, 120, commands.BucketType.user)\n    @mod_check()\n    async def delete_tag(self, ctx, *, name: str):\n        \"\"\"\n        Allows moderators to delete a tag.\n        \"\"\"\n        tag = await self.tag_name_exists(name)\n\n        if tag[0]:\n            try:\n                def check(r, u):\n                    return r.message.id == language_picker.id and u.id != ctx.bot.user.id\n\n                language_picker = await ctx.send(\"Are you sure you want to **__delete__** this tag?\")\n                await asyncio.sleep(1.75)\n                await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"check\"])\n                await language_picker.add_reaction(self.bot.settings[\"emoji\"][\"cross\"])\n\n                responded = False\n                responses = [self.bot.settings[\"emoji\"][\"check\"], self.bot.settings[\"emoji\"][\"cross\"]]\n\n                while not responded:\n                    reaction, user = await self.bot.wait_for(\"reaction_add\", check=check, timeout=30.0)\n\n                    if user.id != ctx.author.id:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif str(reaction) not in responses:\n                        await language_picker.remove_reaction(reaction, user)\n                    elif user.id == ctx.author.id:\n                        await language_picker.clear_reactions()\n\n                        if str(reaction) == self.bot.settings[\"emoji\"][\"check\"]:\n                            tag_backup = \\\n                                discord.File(BytesIO((str(tag[1])).encode(\"utf-8\")),\n                                             filename=f\"{tag[1]['_id']}-{time.time()}.json\")\n\n                            await ctx.author.send(content=f\"Here's a backup of the tag **\\\"**\"\n                                                          f\"{discord.utils.escape_markdown(name, as_needed=False)}\"\n                                                          f\"**\\\"** which you just deleted, Just in case!\",\n                                                  file=tag_backup)\n\n                            await ctx.bot.db.tags.delete_one({\"_id\": tag[1][\"_id\"]})\n\n                            return await ctx.send(\n                                f\"{self.bot.settings['formats']['success']} **Deleted:** Successfully deleted the \"\n                                f\"specified tag.\")\n                        else:\n                            return await ctx.send(\n                                f\"{self.bot.settings['formats']['success']} **Cancelled:** Safely cancelled the \"\n                                f\"deletion of the specified tag.\")\n\n            except asyncio.TimeoutError:\n                return\n        else:\n            return await self.tag_nf_error(ctx, name)\n\n\ndef setup(bot):\n    bot.add_cog(TagsCog(bot))\n"
  },
  {
    "path": "cogs/tickets.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nimport discord\nfrom discord.ext import commands\nfrom ext.checks import mod_check\nfrom datetime import datetime\n\nimport traceback\nimport snowflake\nimport typing\nfrom io import BytesIO\n\nfrom .types import ticketTypes\n\n\nclass TicketCog(commands.Cog, name=\"Tickets\"):\n\n    def __init__(self, bot):\n        self.bot = bot\n        self.help_icon = f\"{self.bot.settings['emoji']['ticket']}\"\n        self.generator = snowflake.Generator()\n        self.closed = 0xdd2e44\n        self.awaiting_response = 0x77ff77\n        self.awaiting_fixes = 0xf4dd1a\n\n    async def snowflake_generate(self):\n        \"\"\"\n        Generates a snowflake ID and checks to ensure it is not a duplicate.\n        \"\"\"\n        while True:\n            generated = self.generator.generate()\n            check_db: ticketTypes.DelTicket = await self.bot.db.tickets.find_one({\"_id\": str(generated)})\n\n            if not check_db:\n                return generated\n\n    @commands.command(name=\"open-ticket\",\n                      aliases=[\"new-ticket\", \"nt\", \"ot\", \"request-changes\", \"rc\", \"create-ticket\", \"open\", \"create\"],\n                      usage=\"open-ticket <bot>\",\n                      description=\"Allows you to open a ticket with the specified bots' developer.\")\n    @commands.guild_only()\n    @mod_check()\n    async def open_ticket(self, ctx, bot: typing.Union[discord.User, str]):\n        \"\"\"\n        Allows you to open a ticket with the specified bots' developer.\n        \"\"\"\n        if isinstance(bot, discord.User):\n            pass\n        elif isinstance(bot, str):\n            if bot.isdigit():\n                try:\n                    bot = await ctx.bot.fetch_user(bot)\n                except Exception as e:\n                    return await \\\n                        ctx.send(f\"{self.bot.settings['formats']['error']} **An error occurred:**\\n```py\\n{e}```\")\n            elif not bot.isdigit():\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Unknown bot:** We could not find a \"\n                                      f\"bot with the arguments you provided - Try using an ID so I can fetch it?\")\n                                           \n        if not bot.bot:\n            return await ctx.send(f\"{self.bot.settings['formats']['error']} **Invalid bot:** {bot} is not a bot.\")\n\n        for channel in ctx.guild.channels:\n            if channel.name == bot.name.lower():\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Duplicated channel:** there is \"\n                                      f\"already a channel for this bot.\")\n\n        try:\n            bot_db = await ctx.bot.db.bots.find_one({\n                \"_id\": str(bot.id)\n            })\n\n            ticket_id = await self.snowflake_generate()\n\n            category = ctx.guild.get_channel(int(self.bot.settings[\"channels\"][\"ticketCategory\"]))\n\n            owner = ctx.guild.get_member(int(bot_db[\"owner\"][\"id\"]))\n            mods = ctx.guild.get_role(int(self.bot.settings[\"roles\"][\"mod\"]))\n            serverbots = ctx.guild.get_role(int(self.bot.settings['roles']['botpower']))\n            \n            if owner is None:\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Owner Missing:** The bot owner is \"\n                                      f\"not in the server!\")\n\n            overwrites = {\n                ctx.guild.default_role: discord.PermissionOverwrite(read_messages=False),\n                owner: discord.PermissionOverwrite(read_messages=True, send_messages=True),\n                mods: discord.PermissionOverwrite(read_messages=True, send_messages=True),\n                serverbots: discord.PermissionOverwrite(read_messages=True, send_messages=True)\n            }\n\n            channel = await category.create_text_channel(name=bot.name.lower(), overwrites=overwrites,\n                                                         reason=f\"Approval feedback channel - {ctx.author.id}\",\n                                                         topic=f\"{self.bot.settings['website']['url']}/bots/{bot.id}\")\n\n            embed = discord.Embed(colour=self.awaiting_response,\n                                  description=\"Hello, whilst reviewing your bot we found some issues, please refer to \"\n                                              \"the message(s) the staff member has sent below. Please do not ping staff members \"\n                                              \"when replying.\",\n                                  timestamp=datetime.utcnow())\n\n            embed.set_author(name=f\"Approval Feedback - {ticket_id} [AWAITING RESPONSE]\",\n                             icon_url=self.bot.settings[\"images\"][\"awaiting_response\"])\n\n            embed.set_footer(text=f\"{str(bot)} ({bot.id})\", icon_url=str(bot.avatar_url))\n\n            message = await channel.send(content=owner.mention, embed=embed,\n                                         allowed_mentions=discord.AllowedMentions(users=True))\n\n            await message.pin()\n            await ctx.send(f\"{self.bot.settings['formats']['success']} **Ticket created:** Successfully created \"\n                           f\"ticket - <#{channel.id}>.\")\n\n            embed2 = discord.Embed(color=self.awaiting_response)\n\n            embed2.set_author(name=f\"Approval Feedback - {ticket_id} [AWAITING RESPONSE]\",\n                              icon_url=self.bot.settings[\"images\"][\"awaiting_response\"])\n\n            embed2.set_footer(text=f\"{str(bot)} ({bot.id})\", icon_url=str(bot.avatar_url))\n\n            embed2.add_field(name=\"Channel\", value=f\"<#{channel.id}>\")\n            embed2.add_field(name=\"Developer\", value=f\"[{str(owner)}]({self.bot.settings['website']['url']}/users/\"\n                                                     f\"{owner.id}) (`{owner.id}`)\")\n\n            testguild = self.bot.get_guild(int(self.bot.settings['guilds']['staff']))\n            fixesrole = testguild.get_role(int(self.bot.settings['roles']['fixesBot']))\n            memberbot = testguild.get_member(bot.id)\n            if memberbot is not None:\n                await memberbot.add_roles(fixesrole, reason='Bot is Awaiting Fixes.')\n\n            log_channel = ctx.guild.get_channel(int(self.bot.settings[\"channels\"][\"ticketLog\"]))\n            log_msg = await log_channel.send(embed=embed2)\n\n            await self.bot.db.tickets.insert_one({\n                \"_id\": str(ticket_id),\n                \"ids\": {\n                    \"channel\": str(channel.id),\n                    \"message\": str(message.id),\n                    \"log\": str(log_msg.id),\n                    \"bot\": str(bot.id)\n                },\n                \"status\": 0,\n                \"closureReason\": None\n            })\n        except Exception as e:\n            return await ctx.send(f\"{self.bot.settings['formats']['error']} **An error occurred:**\\n```{e}```\")\n\n    @commands.command(name=\"awaiting-fixes\", aliases=[\"awaiting-changes\", \"af\", \"ac\", \"fixes\", \"changes\"],\n                      usage=\"awaiting-fixes\", description=\"Updates the current ticket channel's status to Awaiting \"\n                                                          \"Fixes.\")\n    @commands.guild_only()\n    @mod_check()\n    async def awaiting_fixes(self, ctx):\n        \"\"\"\n        Updates the current ticket channel's status to Awaiting Fixes.\n        \"\"\"\n        await ctx.message.delete()\n\n        status_check: ticketTypes.DelTicket = await self.bot.db.tickets.find_one({\n            \"ids.channel\": str(ctx.channel.id)\n        })\n\n        if status_check:\n            message = await ctx.channel.fetch_message(int(status_check[\"ids\"][\"message\"]))\n\n            embed = message.embeds[0]\n            embed.colour = self.awaiting_fixes\n            embed.set_author(name=f\"Approval Feedback - {status_check['_id']} [AWAITING FIXES]\",\n                             icon_url=self.bot.settings[\"images\"][\"awaiting_fixes\"])\n\n            await message.edit(embed=embed)\n\n            await ctx.send(f\"{self.bot.settings['formats']['ticketStatus']} **Ticket update:** Changed ticket \"\n                           f\"status to `Awaiting Fixes`.\")\n\n            ticket: ticketTypes.DelTicket = await self.bot.db.tickets.find_one({\n                \"ids.message\": str(message.id)\n            })\n\n            log_msg = await ctx.guild.get_channel(int(self.bot.settings[\"channels\"][\"ticketLog\"])) \\\n                .fetch_message(int(ticket[\"ids\"][\"log\"]))\n\n            embed2 = log_msg.embeds[0]\n            embed2.colour = self.awaiting_fixes\n            embed2.set_author(name=f\"Approval Feedback - {status_check['_id']} [AWAITING FIXES]\",\n                              icon_url=self.bot.settings[\"images\"][\"awaiting_fixes\"])\n\n            await log_msg.edit(embed=embed2)\n\n            await ctx.bot.db.tickets.update_one({\"ids.channel\": str(ctx.channel.id)}, {\n                \"$set\": {\n                    \"status\": 1\n                }\n            })\n\n        elif status_check and status_check[\"status\"] == 1:\n            return await ctx.send(f\"{self.bot.settings['formats']['error']} **No changes:** This ticket is already set \"\n                                  f\"as `Awaiting Fixes`.\", delete_after=5)\n        else:\n            return await ctx.send(f\"{self.bot.settings['formats']['error']} **Invalid channel:** This is not a valid \"\n                                  f\"ticket channel.\")\n\n    @commands.command(name=\"close-ticket\", aliases=[\"ct\", \"close\"], usage=\"close-ticket\",\n                      description=\"Closes the ticket whose ticket channel you run it in.\")\n    @commands.guild_only()\n    @mod_check()\n    async def close_ticket(self, ctx, *, reason: str):\n        \"\"\"\n        Closes the ticket whose ticket channel you run it in.\n        \"\"\"\n        try:\n            message_id: ticketTypes.DelTicket = await self.bot.db.tickets.find_one({\n                \"ids.channel\": str(ctx.channel.id)\n            })\n\n            if len(reason) > 500:\n                return await ctx.send(\n                    f\"{self.bot.settings['formats']['error']} **Invalid length:** The reason you provided is too \"\n                    f\"long. (`{len(reason) / 500}`)\")\n\n            if message_id:\n                channel_name = ctx.channel.name\n\n                messages = []\n                for message in await ctx.channel.history().flatten():\n                    messages.append(f\"[{message.created_at}] {message.author} - {message.content}\\n\")\n\n                messages.reverse()\n                file = discord.File(BytesIO((\"\".join(messages)).encode(\"utf-8\")), filename=f\"{message_id['_id']}.txt\")\n\n                await ctx.channel.delete(reason=f\"Approval feedback closed - Author: {ctx.author.id}, Ticket ID: \"\n                                                f\"{message_id['_id']}\")\n\n                log_message = await ctx.guild.get_channel(int(self.bot.settings[\"channels\"][\"ticketLog\"])) \\\n                    .fetch_message(message_id[\"ids\"][\"log\"])\n\n                guild = self.bot.get_guild(int(self.bot.settings[\"guilds\"][\"messageLog\"]))\n\n                message_history = await guild.get_channel(int(self.bot.settings[\"channels\"][\"messageLog\"])) \\\n                    .send(content=log_message.jump_url, file=file)\n\n                embed = log_message.embeds[0]\n                embed.colour = self.closed\n                embed.remove_field(0)\n                embed.insert_field_at(0, name=\"Channel\", value=f\"[#{channel_name}](https://txt.discord.website/?txt=\"\n                                                               f\"{self.bot.settings['channels']['messageLog']}\"\n                                                               f\"/{message_history.attachments[0].id}/\"\n                                                               f\"{message_id['_id']})\")\n\n                embed.set_author(name=f\"Approval Feedback - {message_id['_id']} [CLOSED]\",\n                                 icon_url=self.bot.settings[\"images\"][\"closed\"])\n\n                await log_message.edit(embed=embed)\n                await ctx.bot.db.tickets.update_one({\"_id\": str(message_id['_id'])}, {\n                    \"$set\": {\n                        \"status\": 2,\n                        \"closureReason\": reason,\n                        \"ids.history\": str(message_history.id)\n                    }\n                })\n            else:\n                return await ctx.send(f\"{self.bot.settings['formats']['error']} **Invalid channel:** This is not a \"\n                                      f\"valid ticket channel.\")\n        except Exception as e:\n            tb = traceback.format_exception(type(e), e, e.__traceback__)\n            print(\"\".join(tb))\n            await ctx.author.send(f\"Error occured! {e}\")\n\n\ndef setup(bot):\n    bot.add_cog(TicketCog(bot))\n"
  },
  {
    "path": "cogs/types/__init__.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "cogs/types/botTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, List, Optional\nfrom .globalTypes import DelOwner, DelImage\nfrom .discordTypes import DiscordUserFlags\n\n\nclass DelBotReviewNote(TypedDict):\n    note: str\n    author: str\n    date: int\n\n\nclass DelBotVotes(TypedDict):\n    positive: List[str]\n    negative: List[str]\n\n\nclass DelBotLinks(TypedDict):\n    invite: str\n    support: str\n    website: str\n    donation: str\n    repo: str\n    privacyPolicy: str\n\n\nclass DelBotSocial(TypedDict):\n    twitter: str\n\n\nclass DelBotTheme(TypedDict):\n    useCustomColour: bool\n    colour: bool\n    banner: str\n\n\nclass DelBotWidgetBot(TypedDict):\n    channel: str\n    options: str\n    server: str\n\n\nclass DelBotStatus(TypedDict):\n    approved: bool\n    premium: bool\n    siteBot: bool\n    archived: bool\n\n\nclass DelBot(TypedDict):\n    _id: str\n    clientID: str\n    name: str\n    prefix: str\n    library: str\n    tags: List[str]\n    vanityUrl: str\n    serverCount: int\n    shardCount: int\n    inServer: Optional[bool]\n    token: str\n    flags: DiscordUserFlags\n    shortDesc: str\n    longDesc: str\n    modNotes: str\n    reviewNotes: List[DelBotReviewNote]\n    editors: List[str]\n    owner: DelOwner\n    avatar: DelImage\n    votes: DelBotVotes\n    links: DelBotLinks\n    social: DelBotSocial\n    theme: DelBotTheme\n    widgetbot: DelBotWidgetBot\n    status: DelBotStatus\n"
  },
  {
    "path": "cogs/types/discordTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, List, Optional\nfrom enum import Enum\n\n\nclass DiscordUserFlags(Enum):\n    Nil = 0\n    DiscordEmployee = 1\n    DiscordPartner = 2\n    DiscordHypeSquadEvents = 4\n    BugHunterLevel1 = 8\n    HypeSquadHouseBravery = 64\n    HypeSquadHouseBrilliance = 128\n    HypeSquadHouseBalance = 256\n    EarlySupporter = 512\n    TeamUser = 1024\n    System = 4096\n    BugHunterLevel2 = 16384\n    VerifiedBot = 65536\n    VerifiedBotDeveloper = 131072\n\n\nclass DiscordUserPremiumType(Enum):\n    Nil = 0\n    NitroClassic = 1\n    Nitro = 2\n\n\nclass DiscordUser(TypedDict):\n    id: str\n    username: str\n    discriminator: str\n    avatar: str\n    bot: Optional[bool]\n    system: Optional[bool]\n    mfa_enabled: Optional[bool]\n    locale: Optional[str]\n    verified: Optional[bool]\n    email: Optional[str]\n    flags: Optional[DiscordUserFlags]\n    premium_type: DiscordUserPremiumType\n    public_flags: Optional[DiscordUserFlags]\n\n\nclass DiscordRoleTags(TypedDict):\n    bot_id: Optional[str]\n    # premium_subscriber: None\n    integration_id: Optional[str]\n\n\nclass DiscordRole(TypedDict):\n    id: str\n    name: str\n    color: int\n    hoist: bool\n    position: int\n    permissions: int  # DEPRECATED - Use permissions_new instead\n    permissions_new: str\n    managed: bool\n    mentionable: bool\n    tags: Optional[DiscordRoleTags]\n\n\nclass DiscordPartialChannel(TypedDict):\n    id: str\n    type: str\n    name: str\n\n\nclass DiscordOverwriteTypes(Enum):\n    Member = \"member\"\n    Role = \"role\"\n\n\nclass DiscordOverwrites(TypedDict):\n    id: str\n    type: DiscordOverwriteTypes\n    allow: int  # DEPRECATED - Use allow_new instead\n    allow_new: str\n    deny: int  # DEPRECATED - Use deny_new instead\n    deny_new: str\n\n\nclass DiscordChannel(DiscordPartialChannel):\n    guild_id: Optional[str]\n    position: int\n    permission_overwrites: Optional[List[DiscordOverwrites]]\n    topic: Optional[str]\n    nsfw: Optional[bool]\n    last_message_id: Optional[str]\n    bitrate: Optional[int]\n    user_limit: Optional[int]\n    rate_limit_per_user: Optional[int]\n    recipients: Optional[DiscordUser]\n    icon: Optional[str]\n    owner_id: Optional[str]\n    application_id: Optional[str]\n    parent_id: Optional[str]\n    last_pin_timestamp: Optional[str]\n"
  },
  {
    "path": "cogs/types/globalTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict\n\n\nclass DelOwner(TypedDict):\n    id: str\n\n\nclass DelImage(TypedDict):\n    hash: str\n    url: str\n\n\nclass DelAdminToken(TypedDict):\n    _id: str\n    token: str\n    lastUpdate: int\n    validUntil: int\n"
  },
  {
    "path": "cogs/types/serverTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, List\nfrom .globalTypes import DelOwner, DelImage\n\n\nclass DelServerLinks(TypedDict):\n    invite: str\n    website: str\n    donation: str\n\n\nclass DelServerStatus(TypedDict):\n    reviewRequired: bool\n\n\nclass DelServer(TypedDict):\n    _id: str\n    inviteCode: str\n    name: str\n    shortDesc: str\n    longDesc: str\n    tags: List[str]\n    previewChannel: str\n    owner: DelOwner\n    icon: DelImage\n    links: DelServerLinks\n    status: DelServerStatus\n"
  },
  {
    "path": "cogs/types/tagTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, List, Optional\n\n\nclass DelTagContents(TypedDict):\n    en: str\n    tr: str\n    fr: str\n    pt: str\n\n\nclass DelTag(TypedDict):\n    _id: str\n    creator: str\n    creationDate: int\n    contents: DelTagContents\n    aliases: Optional[List[str]]\n"
  },
  {
    "path": "cogs/types/templateTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, List\nfrom .globalTypes import DelOwner, DelImage\nfrom .discordTypes import DiscordRole, DiscordChannel\n\n\nclass DelTemplateLinks(TypedDict):\n    linkToServerPage: bool\n    template: str\n\n\nclass DelTemplate(TypedDict):\n    _id: str\n    name: str\n    region: str\n    locale: str\n    afkTimeout: int\n    verificationLevel: int\n    defaultMessageNotifications: int\n    explicitContent: int\n    roles: List[DiscordRole]\n    channels: List[DiscordChannel]\n    usageCount: int\n    shortDesc: str\n    longDesc: str\n    tags: List[str]\n    fromGuild: str\n    owner: DelOwner\n    icon: DelImage\n    links: DelTemplateLinks\n"
  },
  {
    "path": "cogs/types/ticketTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, Optional\nfrom enum import Enum\n\n\nclass DelTicketIds(TypedDict):\n    channel: str\n    message: str\n    log: str\n    bot: str\n    history: Optional[str]\n\n\nclass DelTicketStatus(Enum):\n    AwaitingResponse = 0\n    AwaitingFixes = 1\n    Closed = 2\n\n\nclass DelTicket(TypedDict):\n    _id: str\n    ids: DelTicketIds\n    status: DelTicketStatus\n    closureReason: Optional[str]\n"
  },
  {
    "path": "cogs/types/userStaffTrackingTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, List, Optional\n\n\nclass DelStaffTrackingDetailsAway(TypedDict):\n    status: bool\n    message: str\n\n\nclass DelStaffTrackingDetails(TypedDict):\n    away: DelStaffTrackingDetailsAway\n    standing: str\n    country: str\n    timezone: str\n    managementNotes: str\n    languages: List[str]\n\n\nclass DelStaffTrackingLastAccessed(TypedDict):\n    time: int\n    page: str\n\n\nclass DelStaffTrackingPunishmentsSub(TypedDict):\n    executorName: Optional[str]\n    executor: str\n    reason: str\n    date: int\n\n\nclass DelStaffTrackingPunishmentsStrike(DelStaffTrackingPunishmentsSub):\n    pass\n\n\nclass DelStaffTrackingPunishmentsWarning(DelStaffTrackingPunishmentsSub):\n    pass\n\n\nclass DelStaffTrackingPunishments(TypedDict):\n    strikes: DelStaffTrackingPunishmentsStrike\n    warnings: DelStaffTrackingPunishmentsWarning\n\n\nclass DelStaffTrackingHandledSub(TypedDict):\n    total: int\n    approved: int\n    unapprove: Optional[int]\n    declined: int\n    remove: int\n\n\nclass DelStaffTrackingHandled(TypedDict):\n    allTime: DelStaffTrackingHandledSub\n    prevWeek: DelStaffTrackingHandledSub\n    thisWeek: DelStaffTrackingHandledSub\n\n\nclass DelStaffTracking(TypedDict):\n    details: DelStaffTrackingDetails\n    lastLogin: int\n    lastAccessed: DelStaffTrackingLastAccessed\n    punishments: DelStaffTrackingPunishments\n    handledBots: DelStaffTrackingHandled\n    handledServers: DelStaffTrackingHandled\n    handledTemplates: DelStaffTrackingHandled\n"
  },
  {
    "path": "cogs/types/userTypes.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nfrom typing import TypedDict, List\nfrom .globalTypes import DelImage\nfrom .discordTypes import DiscordUserFlags\nfrom .userStaffTrackingTypes import DelStaffTracking\n\n\nclass DelUserPreferences(TypedDict):\n    customGlobalCss: str\n    defaultColour: str\n    defaultForegroundColour: str\n    enableGames: bool\n    experiments: bool\n    theme: int\n\n\nclass DelUserProfileLinks(TypedDict):\n    website: str\n    github: str\n    gitlab: str\n    twitter: str\n    instagram: str\n    snapchat: str\n\n\nclass DelUserProfile(TypedDict):\n    bio: str\n    css: str\n    links: DelUserProfileLinks\n\n\nclass DelUserGameSnakes(TypedDict):\n    maxScore: int\n\n\nclass DelUserGame(TypedDict):\n    snakes: DelUserGameSnakes\n\n\nclass DelUserRank(TypedDict):\n    admin: bool\n    assistant: bool\n    mod: bool\n    premium: bool\n    tester: bool\n    translator: bool\n    covid: bool\n\n\nclass DelUser(TypedDict):\n    _id: str\n    token: str\n    name: str\n    discrim: str\n    fullUsername: str\n    locale: str\n    flags: DiscordUserFlags\n    avatar: DelImage\n    preferences: DelUserPreferences\n    profile: DelUserProfile\n    game: DelUserGame\n    rank: DelUserRank\n    staffTracking: DelStaffTracking\n"
  },
  {
    "path": "cogs/utility.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nimport discord\nfrom discord.ext import commands\nfrom ext.checks import *\n\nfrom time import monotonic\nfrom .types import botTypes, userTypes\n\n\nclass UtilityCog(commands.Cog, name=\"Utility\"):\n\n    def __init__(self, bot):\n        self.bot = bot\n        self.help_icon = f\"{self.bot.settings['emoji']['toolbox']}\"\n\n    async def embed_colour(self, ctx):\n        global colour\n\n        bot_guild_member = await ctx.guild.fetch_member(self.bot.user.id)\n        if len(str(bot_guild_member.colour.value)) == 1:\n            colour = 0xFFFFFA\n        else:\n            colour = bot_guild_member.colour.value\n\n        return colour\n\n    @commands.command(name=\"ping\", aliases=[\"latency\", \"pingpong\", \"pong\"], usage=\"ping\",\n                      description=\"Allows you to get the bots' current ping.\")\n    async def ping(self, ctx):\n        \"\"\"\n        Allows you to get the bots' current ping.\n        \"\"\"\n        before = monotonic()\n        await ctx.trigger_typing()\n        ping = (monotonic() - before) * 1000\n        # you gotta have the ping pong paddle\n        await ctx.message.add_reaction('🏓')\n        await ctx.send(f\"{self.bot.settings['emoji']['ping']} | **Pong! My ping is:** `{int(ping)}ms`\")\n\n    # noinspection DuplicatedCode\n    @commands.command(name=\"userinfo\", aliases=[\"ui\", \"profile\"], usage=\"userinfo <user>\",\n                      description=\"Allows you to get your own or another user's DEL profile information.\")\n    @commands.guild_only()\n    async def user_info(self, ctx, *, user: discord.User = None):\n        \"\"\"\n        Allows you to get your own or another user's DEL profile information.\n        \"\"\"\n        if user is None:\n            user = ctx.author\n\n        db_user: userTypes.DelUser = await self.bot.db.users.find_one({\"_id\": str(user.id)})\n        if not db_user:\n            raise NoSomething(user)\n\n        embed = discord.Embed(colour=await self.embed_colour(ctx))\n\n        acknowledgements = []\n        badges = []\n\n        if db_user[\"rank\"][\"admin\"]:\n            acknowledgements.append(\"Website Administrator\")\n            badges.append(self.bot.settings[\"emoji\"][\"crown\"])\n\n        if db_user[\"rank\"][\"assistant\"]:\n            acknowledgements.append(\"Website Assistant\")\n            badges.append(self.bot.settings[\"emoji\"][\"assistant\"])\n\n        if db_user[\"rank\"][\"mod\"]:\n            acknowledgements.append(\"Website Moderator\")\n            badges.append(self.bot.settings[\"emoji\"][\"hammer\"])\n\n        if db_user[\"rank\"][\"premium\"]:\n            acknowledgements.append(\"Donator\")\n            badges.append(self.bot.settings[\"emoji\"][\"heart\"])\n\n        if db_user[\"rank\"][\"tester\"]:\n            acknowledgements.append(\"Tester\")\n            badges.append(self.bot.settings[\"emoji\"][\"tube\"])\n\n        if db_user[\"rank\"][\"translator\"]:\n            acknowledgements.append(\"Translator\")\n            badges.append(self.bot.settings[\"emoji\"][\"url\"])\n\n        if db_user[\"rank\"][\"covid\"]:\n            acknowledgements.append(\"COVID-19 Donator\")\n            badges.append(self.bot.settings[\"emoji\"][\"shield\"])\n\n        embed.add_field(name=f\"{self.bot.settings['emoji']['shadows']} Username\", value=f\"{db_user['fullUsername']}\"\n                                                                                        f\" {' '.join(badges)}\")\n        embed.add_field(name=f\"{self.bot.settings['emoji']['id']} ID\", value=db_user[\"_id\"])\n\n        if acknowledgements != []:\n            embed.add_field(name=f\"{self.bot.settings['emoji']['crown']} Acknowledgements\",\n                            value=\"\\n\".join(acknowledgements), inline=False)\n\n        embed.add_field(name=f\"{self.bot.settings['emoji']['url']} Profile URL\",\n                        value=f\"{self.bot.settings['website']['url']}/users/{db_user['_id']}\", inline=False)\n        embed.set_thumbnail(url=f\"{db_user['avatar']['url']}\")\n\n        await ctx.send(embed=embed)\n\n    # noinspection DuplicatedCode\n    @commands.command(name=\"botinfo\", aliases=[\"bi\"], usage=\"botinfo <bot>\",\n                      description=\"Allows you to get information of a bot.\")\n    @commands.guild_only()\n    async def robot_info(self, ctx, *, bot: discord.User):\n        \"\"\"\n        Allows you to get information of a bot.\n        \"\"\"\n        if not bot.bot:\n            return await ctx.send(\"That's no bot\")\n\n        db_bot: botTypes.DelBot = await self.bot.db.bots.find_one({\"_id\": str(bot.id)})\n\n        if not db_bot:\n            raise NoSomething(bot)\n\n        bot_owner: userTypes.DelUser = await self.bot.db.users.find_one({\"_id\": db_bot[\"owner\"][\"id\"]})\n\n        embed = discord.Embed(colour=await self.embed_colour(ctx))\n\n        embed.add_field(name=f\"{self.bot.settings['emoji']['shadows']} Bot Name\", value=db_bot[\"name\"])\n        embed.add_field(name=f\"{self.bot.settings['emoji']['id']} ID\", value=db_bot[\"_id\"])\n        embed.add_field(name=f\"{self.bot.settings['emoji']['crown']} Developer\",\n                        value=f\"[{bot_owner['fullUsername']}]({self.bot.settings['website']['url']}/users/{bot_owner['_id']})\")\n        embed.add_field(name=f\"{self.bot.settings['emoji']['infoBook']} Library\", value=db_bot[\"library\"])\n        if db_bot[\"prefix\"]:\n            embed.add_field(name=f\"{self.bot.settings['emoji']['speech']} Prefix\", value=db_bot[\"prefix\"])\n        embed.add_field(name=f\"{self.bot.settings['emoji']['shield']} Server Count\",\n                        value=str(db_bot[\"serverCount\"]))\n        embed.add_field(name=f\"{self.bot.settings['emoji']['url']} Listing URL\",\n                        value=f\"{self.bot.settings['website']['url']}/bots/{db_bot['_id']}\", inline=False)\n        embed.set_thumbnail(url=bot.avatar_url)\n\n        await ctx.send(embed=embed)\n\n    @commands.command(name=\"token\", aliases=[\"delapitoken\", \"apikey\", \"apitoken\"], usage=\"token <bot>\",\n                      description=\"Allows you to get the DELAPI token of the specified bot (provided you own it).\")\n    @commands.guild_only()\n    async def token(self, ctx, *, bot: discord.User):\n        \"\"\"\n        Allows you to get the DELAPI token of the specified bot (provided you own it).\n        \"\"\"\n        db_bot: botTypes.DelBot = await self.bot.db.bots.find_one({\"_id\": str(bot.id)})\n\n        if not db_bot:\n            raise NoSomething(bot)\n\n        if db_bot[\"owner\"][\"id\"] == str(ctx.author.id):\n            embed = discord.Embed(colour=await self.embed_colour(ctx))\n\n            embed.add_field(name=f\"{self.bot.settings['emoji']['shadows']} Bot Name\", value=db_bot[\"name\"])\n            embed.add_field(name=f\"{self.bot.settings['emoji']['id']} ID\", value=db_bot[\"_id\"])\n            embed.add_field(name=f\"{self.bot.settings['emoji']['cog']} Token\", value=f\"```{db_bot['token']}```\",\n                            inline=False)\n            embed.set_thumbnail(url=f\"{db_bot['avatar']['url']}.png\")\n\n            try:\n                await ctx.author.send(embed=embed)\n                await ctx.send(\n                    f\"{self.bot.settings['formats']['success']} {bot}'s token has been dm'ed to you\")\n            except:\n                await ctx.send(\"Your dms appear to be closed\")\n        else:\n            await ctx.send(\n                f\"{self.bot.settings['formats']['noPerms']} **Invalid permission(s):** You need to be the \"\n                f\"owner of the specified bot to access it's token.\")\n\n    @commands.command(name=\"cssreset\", aliases=[\"resetcss\", \"ohshitohfuck\"],\n                      description=\"Allows you to reset your 'Custom CSS' if you've broken something.\")\n    @commands.guild_only()\n    async def css_reset(self, ctx):\n        \"\"\"\n        Allows you to reset your 'Custom CSS' if you've broken something.\n        \"\"\"\n        db_user: userTypes.DelUser = await self.bot.db.users.find_one({\"_id\": str(ctx.author.id)})\n\n        if not db_user:\n            raise NoSomething(ctx.author)\n\n        if db_user:\n            await self.bot.db.users.update_one({\"_id\": str(ctx.author.id)}, {\n                \"$set\": {\n                    \"profile.css\": \"\"\n                }\n            })\n\n            return await ctx.send(\n                f\"{self.bot.settings['formats']['success']} **Success:** Your custom css was reset.\")\n        else:\n            return await ctx.send(\n                f\"{self.bot.settings['formats']['error']} **Unknown account:** You need to have authenticated on \"\n                f\"our website before to use this command.\")\n\n    @commands.command(name=\"showbots\", aliases=[\"bl\", \"hasbots\", \"hasbot\", \"bots\"], usage=\"showbots <user>\",\n                      description=\"Allows you to view the bots a specified user has.\")\n    @commands.guild_only()\n    async def show_bots(self, ctx, *, user: discord.User = None):\n        \"\"\"\n        Allows you to view the bots a specified user has.\n        \"\"\"\n        user = user or ctx.author\n\n        db_bots = self.bot.db.bots.find({\"owner\": {\"id\": str(user.id)}})\n\n        if user.bot:\n            return await ctx.send(\n                f\"{self.bot.settings['formats']['error']} **Bots can't own bots:** Bots can't make bots... \"\n                f\"AI robots please don't kill me...\")\n\n        formatted_bots = []\n        async for db_bot in db_bots:\n            db_bot: botTypes.DelBot\n            formatted_bots.append(\n                f\"• [{db_bot['name']}]({self.bot.settings['website']['url']}/bots/{db_bot['_id']}) \"\n                f\"(`{db_bot['_id']}`)\")\n\n        if not formatted_bots:\n            return await ctx.send(\n                f\"{self.bot.settings['formats']['error']} **No bots:** This user has no bots listed.\")\n\n        embed = discord.Embed(colour=await self.embed_colour(ctx))\n        embed.add_field(name=f\"{self.bot.settings['emoji']['robot']} {str(user)}'s Bot(s)\",\n                        value=\"\\n\".join(formatted_bots), inline=False)\n        embed.set_thumbnail(url=f\"{user.avatar_url}\")\n\n        await ctx.send(embed=embed)\n\n    @commands.command(name=\"subscribe\", aliases=[\"unsubscribe\", \"unsub\", \"sub\"], usage=\"subscribe\",\n                      description=\"Allows you to subscribe or unsubscribe from @Subscribers pings.\")\n    @commands.guild_only()\n    async def subscribe(self, ctx):\n        \"\"\"\n        Allows you to subscribe or unsubscribe from @Subscribers pings.\n        \"\"\"\n        guild = self.bot.get_guild(int(self.bot.settings[\"guilds\"][\"main\"]))\n        subscribe_role = guild.get_role(int(self.bot.settings[\"roles\"][\"subscribers\"]))\n\n        if subscribe_role not in ctx.author.roles:\n            await ctx.author.add_roles(subscribe_role, reason=\"User has subscribed.\")\n            await ctx.send(\n                f\"{self.bot.settings['formats']['success']} You have been subscribed to news pings.\")\n        else:\n            await ctx.author.remove_roles(subscribe_role, reason=\"User has un-subscribed.\")\n            await ctx.send(\n                f\"{self.bot.settings['formats']['success']} You have un-subscribed from news pings.\")\n\n\ndef setup(bot):\n    bot.add_cog(UtilityCog(bot))\n"
  },
  {
    "path": "docs/STATUS_TYPES.md",
    "content": "```yaml\nWaiting for Response: 0\nAwaiting Fixes: 1\nClosed: 2\nDev Responded: 3\n```"
  },
  {
    "path": "ext/checks.py",
    "content": "import discord\nimport json\nfrom discord.ext import commands\n\nwith open(\"settings.json\") as content:\n    settings = json.load(content)\n\n\nclass NoMod(commands.CheckFailure):\n    pass\n\n\nclass NoSomething(commands.CommandError):\n    def __init__(self, account: discord.User):\n        self.user = account\n        if account.bot:\n            fmt = f\"**Invalid bot:** I could not find {account} in my \" \\\n                  \"database.\"\n        else:\n            fmt = f\"**Invalid user:** I could not find {account} in my \" \\\n                  \"database.\"\n\n        self.message = fmt\n        super().__init__(fmt)\n\n\ndef mod_check():\n    async def predicate(ctx):\n        db_user = await ctx.bot.db.users.find_one({\"_id\": str(ctx.author.id)})\n        if db_user is None or not db_user['rank']['mod']:\n            raise NoMod()\n\n        return True\n\n    return commands.check(predicate)\n"
  },
  {
    "path": "ext/context.py",
    "content": "# Discord Extreme List - Discord's unbiased list.\n\n# Copyright (C) 2020-2025 Carolina Mitchell, Advaith Jagathesan, John Burke\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Affero General Public License for more details.\n\n# You should have received a copy of the GNU Affero General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nimport discord\nfrom discord.ext import commands\n\n\nclass EditingContext(commands.Context):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n\n    async def send(self, content=None, *, tts=False, embed=None, file=None, files=None, delete_after=None, nonce=None,\n                   allowed_mentions=None):\n        if file or files:\n            return await super().send(content=content, tts=tts, embed=embed, file=file, files=files,\n                                      delete_after=delete_after, nonce=nonce, allowed_mentions=allowed_mentions)\n        reply = None\n        try:\n            reply = self.bot.cmd_edits[self.message.id]\n        except KeyError:\n            pass\n        if reply:\n            return await reply.edit(content=content, embed=embed, delete_after=delete_after)\n        reference = self.message.reference\n        if reference and isinstance(reference.resolved, discord.Message):\n            msg = await reference.resolved.reply(content=content, tts=tts, embed=embed, file=file, files=files, delete_after=delete_after, nonce=nonce, allowed_mentions=allowed_mentions)\n        else:\n            msg = await super().send(content=content, tts=tts, embed=embed, file=file, files=files,\n                                     delete_after=delete_after, nonce=nonce, allowed_mentions=allowed_mentions)\n        self.bot.cmd_edits[self.message.id] = msg\n        return msg\n\n\n\n"
  },
  {
    "path": "requirements.txt",
    "content": "aiohttp==3.7.4\nastunparse==1.6.3\nasync-timeout==3.0.1\nattrs==20.3.0\nbraceexpand==0.1.6\nchardet==3.0.4\ncolorama==0.4.4\ncolouredlogs==10.0.1\ndiscord.py==1.6.0\ndnspython==2.0.0\nhumanfriendly==4.7\nhumanize==3.2.0\nidna==2.10\nimport-expression==1.1.4\njishaku==1.20.0.220\nmotor==2.3.0\nmultidict==4.7.6\npymongo==3.11.2\npyreadline==2.1\nsix==1.15.0\nsnowflake.py==1.0.0\nyarl==1.5.1\n"
  },
  {
    "path": "settings.example.json",
    "content": "{\r\n  \"token\": \"\",\r\n  \"prefix\": [\"del,\"],\r\n  \"mongo\": {\r\n    \"uri\": \"mongodb://localhost:27017\",\r\n    \"db\": \"del\"\r\n  },\r\n  \"ownership\": {\r\n    \"multiple\": true,\r\n    \"owners\": [0],\r\n    \"owner\": 0\r\n  },\r\n  \"guilds\": {\r\n    \"main\": \"\",\r\n    \"staff\": \"\",\r\n    \"bot\": \"\",\r\n    \"messageLog\": \"\"\r\n  },\r\n  \"website\": {\r\n    \"url\": \"https://discordextremelist.xyz\"\r\n  },\r\n  \"roles\": {\r\n    \"unapprovedBot\": \"633141192497823784\",\r\n    \"bot\": \"568587927265869824\",\r\n    \"premiumBot\": \"568970918647300116\",\r\n    \"serverOwner\": \"623052263295942657\",\r\n    \"developer\": \"568572172151291929\",\r\n    \"staff\": \"568568238250917909\",\r\n    \"mod\": \"568568238250917909\",\r\n    \"admin\": \"568568341414019086\",\r\n    \"unlisted\": \"736732871708115024\",\r\n    \"fixesBot\": \"662230379326865429\",\r\n    \"botpower\": \"716174811629486141\",\r\n    \"subscribers\": \"703779239400570880\",\r\n    \"botServer\": {\r\n      \"listed\": \"1342399369311162368\"\r\n    }\r\n  },\r\n  \"colours\": {\r\n    \"awaiting_fixes\": \"0xf73538\",\r\n    \"awaiting_response\": \"0x1cc1e6\",\r\n    \"closed\": \"0xe40707\"\r\n  },\r\n  \"channels\": {\r\n    \"ticketCategory\": \"736820335629828159\",\r\n    \"ticketLog\": \"736820647484981268\",\r\n    \"messageLog\": \"736823970334113862\"\r\n  },\r\n  \"images\": {\r\n    \"awaiting_fixes\": \"https://raw.githubusercontent.com/discordextremelist/bot/master/assets/awaiting_fixes-1.png\",\r\n    \"awaiting_response\": \"https://raw.githubusercontent.com/discordextremelist/bot/master/assets/awaiting_response-2.png\",\r\n    \"closed\": \"https://raw.githubusercontent.com/discordextremelist/bot/master/assets/closed-3.png\",\r\n    \"dev_replied\": \"https://raw.githubusercontent.com/discordextremelist/bot/master/assets/dev_replied-4.png\"\r\n  },\r\n  \"formats\": {\r\n    \"error\": \"<:error:621988943314812928> |\",\r\n    \"warn\": \"<:warning:599554018406039574> |\",\r\n    \"success\": \"<:check:587490138129563649> |\",\r\n    \"noPerms\": \"<:cross:587490138129432596> |\",\r\n    \"ticketStatus\": \"<:flag:736795389210001497> |\",\r\n    \"info\": \"<:info:645226250889068584> |\"\r\n  },\r\n  \"emoji\": {\r\n    \"flags\": {\r\n      \"britian\": \"<:britian:769505989183012884>\",\r\n      \"turkey\": \"<:turkey:769506407439138846>\",\r\n      \"france\": \"<:france:769506407518568458>\",\r\n      \"portugal\": \"<:portugal:769506407636140052>\",\r\n      \"spain\": \"<:spain:769506407438352424>\"\r\n    },\r\n    \"check\": \"<:check:587490138129563649>\",\r\n    \"cross\": \"<:cross:587490138129432596>\",\r\n    \"home\": \"<:home:599501387516215326>\",\r\n    \"hammer\": \"<:hammer:599508413302439961>\",\r\n    \"toolbox\": \"<:toolbox:599508422823641118>\",\r\n    \"speech\": \"<:talking:599519046509133885>\",\r\n    \"warning\": \"<:warning:599554018406039574>\",\r\n    \"boot\": \"<:boot:599553995731763201>\",\r\n    \"bell\": \"<:bell:599554581466316800>\",\r\n    \"alarm\": \"<:alarm:599554591146639380>\",\r\n    \"crayon\": \"<:crayon:599555499377295390>\",\r\n    \"brush\": \"<:brush:599555488539213825>\",\r\n    \"serviceBell\": \"<:servicebell:599556134298189824>\",\r\n    \"calendar\": \"<:calendar:599556100206886924>\",\r\n    \"eject\": \"<:eject:599556110789115925>\",\r\n    \"crown\": \"<:crown:599557812259127297>\",\r\n    \"shadows\": \"<:shadows:599557820723101698>\",\r\n    \"places\": \"<:places:599557829862621204>\",\r\n    \"shield\": \"<:shield:599558630177767424>\",\r\n    \"filter\": \"<:filter:599558621067739136>\",\r\n    \"sound\": \"<:sound:599559909931221014>\",\r\n    \"ear\": \"<:ear:599559784244445186>\",\r\n    \"notepad\": \"<:notepad:599559758189559829>\",\r\n    \"bin\": \"<:bin:600126267999780885>\",\r\n    \"cog\": \"<:cog:667646832805150731>\",\r\n    \"infoBook\": \"<:verificationApp:589349182234558470>\",\r\n    \"id\": \"<:id:669089983986139136>\",\r\n    \"robot\": \"<:robot:669089983990333441>\",\r\n    \"entry\": \"<:entry:669089983507726371>\",\r\n    \"game\": \"<:game:669089983692537857>\",\r\n    \"online\": \"<:online:669089983570903040>\",\r\n    \"idle\": \"<:idle:669089983323439105>\",\r\n    \"dnd\": \"<:dnd:669089984002916352>\",\r\n    \"offline\": \"<:offline:669089983621234688>\",\r\n    \"smilie\": \"<:smilie:669103681639022592>\",\r\n    \"label\": \"<:label:669364669797892127>\",\r\n    \"phone\": \"<:phone:669466706565005312>\",\r\n    \"desktop\": \"<:desktop:669466706447695883>\",\r\n    \"coder\": \"<:coder:669739780824760330>\",\r\n    \"ping\": \"<:ping:668013200918446080>\",\r\n    \"minidisc\": \"<:minidisc:669745576048459779>\",\r\n    \"disc\": \"<:dvd:669745576124088371>\",\r\n    \"chart\": \"<:graph:669755531186929665>\",\r\n    \"womanboot\": \"<:womanboot:670553673390227456>\",\r\n    \"zipped\": \"<:zipped:670786074876051487>\",\r\n    \"unlock\": \"<:unlock:682475650371944454>\",\r\n    \"url\": \"<:globe:695565597173481493>\",\r\n    \"clock\": \"<:clock:726557245869129831>\",\r\n    \"timer\": \"<:timer:726557246171119716>\",\r\n    \"assistant\": \"<:webAssistant:664734569773269003>\",\r\n    \"heart\": \"<:heart:749527451948023820>\",\r\n    \"tube\": \"<:tube:749529449535635516>\",\r\n    \"ticket\": \"<:ticket:769354945056604171>\",\r\n    \"high_voltage\": \"<:high_voltage:769354944930381826>\",\r\n    \"info\": \"<:info:645226250889068584>\"\r\n  }\r\n}\r\n"
  }
]