{"id":26115659,"url":"https://github.com/kyrela/discore","last_synced_at":"2025-04-13T04:37:28.197Z","repository":{"id":41803082,"uuid":"488147513","full_name":"Kyrela/discore","owner":"Kyrela","description":"A core for easily initialise and run discord.py bots, and track logs and errors","archived":false,"fork":false,"pushed_at":"2025-03-18T20:04:51.000Z","size":3308,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T21:37:38.831Z","etag":null,"topics":["bot","discord","discord-py","env","help","i18n","initializer","log"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kyrela.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-03T09:26:49.000Z","updated_at":"2025-03-18T20:04:55.000Z","dependencies_parsed_at":"2025-01-16T20:35:03.221Z","dependency_job_id":"2e083b18-8683-4be2-869d-404b62443910","html_url":"https://github.com/Kyrela/discore","commit_stats":null,"previous_names":["kbotswork/discore","kyrela/discore"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyrela%2Fdiscore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyrela%2Fdiscore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyrela%2Fdiscore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyrela%2Fdiscore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kyrela","download_url":"https://codeload.github.com/Kyrela/discore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665764,"owners_count":21142121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","discord","discord-py","env","help","i18n","initializer","log"],"created_at":"2025-03-10T07:56:47.442Z","updated_at":"2025-04-13T04:37:28.162Z","avatar_url":"https://github.com/Kyrela.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discore\n\n![License](https://img.shields.io/github/license/kyrela/discore)\n![Development](https://img.shields.io/badge/Development%20Status-Beta-orange)\n\nA core for initialise, run and tracks errors of discord.py bots, with a \"Convention over configuration\" philosophy\n\n## Features\n\n- One-line bot initialisation and one-line run\n- better default help hybrid command\n- All information stored in a configuration file\n- Automatic error handling and responses\n- Automatic logging for each command failed\n- localisation automatic detection and support\n- Multiple environment support\n- Backwards compatibility with discord.py\n\n## Installation\n\n**Python 3.6 or above is required**\n\nJust run the following command\n\n```bash\npip install git+https://github.com/Kyrela/discore\n```\n\n## Usage example\n\nproject architecture\n\n```\nproject\n├─ main.py   # name can be anything\n├─ config.yml   # if name is different from it, it should be passed as an argument to the class\n├─ cogs   # the name has to be 'cogs'\n│  ├─ cog1.py   # the cog class contained by the file should be equal to filename.title() \n│  └─ cog2.py   # example : 'cog2.py' contains the cog 'Cog2'\n└─ locales   # the name has to be 'locales'\n   ├─ en-US.yml   # the locale file should be named with the language code\n   └─ fr.yml   # example : 'fr.yml' contains the locale for french\n```\n\n`main.py` code:\n\n```python\nimport discore\n\nbot = discore.Bot()  # if the name of the config file is different from 'config.toml', it should be passed as an argument here. \n\n# Your usual commands here, or in a cog\n\nbot.run()\n```\n\n`config.yml`:\n\n```yaml\nprefix: \"!\"\ntoken: \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\ndescription: \"A basic test bot\"\nversion: \"1.0\"\ncolor: 0x35901E\nhot_reload: true\nauto_sync: true\ncase_insensitive: true\nlocale: \"en-US\"\n\nhelp:\n  cog: \"system\"\n  name: \"help\"\n  help: \"Shows this message\"\n  description: \"Shows help about the bot, a command, or a category\"\n  usage: \"[command | category]\"\n  brief: \"Shows help about the bot\"\n  aliases: [ \"h\", \"hp\" ]\n  cooldown: null\n  enabled: true\n  hidden: false\n\nlog:\n  channel: 1111111111111\n  file: \"log.txt\"\n  alert_user: true\n  commands: false\n  stream: true\n  level: \"INFO\"\n  root: true\n  stream_to_err: true\n  format: \"[{asctime}] {levelformat} {name}: {message}\"\n  date_format: \"%Y-%m-%d %H:%M:%S\"\n  level_format:\n    debug: \"[{bg_black}{bold}DEBUG{no_bold}{bg_normal}]   \"\n    info: \"[{blue}{bold}INFO{no_bold}{normal}]    \"\n    warning: \"[{yellow}{bold}WARNING{no_bold}{normal}] \"\n    error: \"[{red}ERROR{normal}]   \"\n    critical: \"[{bg_red}CRITICAL{bg_normal}]\"\n\noverride_config: override.config.yml\n```\n\n\u003e Note : the log file is created if it does not exist, and all variables are optional except 'token'.\n\u003e If a variable isn't provided, its value is set to the value showed in this example, except for\n\u003e `log.channel`, `log.file`, `version`, `color`, `description`, `help.*`, and `override_config` as they are\n\u003e set to `None`. More information on used variables below.\n\u003e You can of course store additional information in the file and access them at anytime, anywhere.\n\n`cog1.py`:\n\n```py\nimport discore\n\n\nclass Cog1(discore.Cog, name=\"cog1\", description=\"the cog containing some commands\"):\n    @discore.command(\n        name=\"say\",\n        brief=\"Say something\",\n        description=\"Sends a message containing the string passed as an argument, and deletes the original message.\",\n        help=\"- `message` : The string to send\"\n    )\n    async def say(self, ctx, *, message: str):\n        await ctx.message.delete()\n        await ctx.send(message)\n\n    @discore.command(\n        name=\"ping\",\n        brief=\"check if the bot is online\",\n        description=\"Responds with a simple message, useful to see if the bot is online\"\n    )\n    async def ping(self, ctx):\n        await ctx.message.reply(\"Pong!\")\n```\n\n`en-US.yml`:\n\n```yaml\nhelp:\n  no_commands: \"*No commands*\"\n  bot:\n    title: \"Help menu\"\n    description: \"Use `%{help_command} [command]` for more info on a command.\\nYou can also use `%{help_command} [category]` for more info on a category.\"\n    no_category: \"No category\"\n  cog:\n    title: \"%{cog} commands\"\n    commands: \"Commands\"\n  group:\n    title: \"%{group} group\"\n  command:\n    title: \"%{command} command\"\n    not_found: \"No command called `%{command}` found.\"\n  subcommand:\n    not_found: \"Command `%{command}` has no subcommand named `%{subcommand}`\"\n    no_subcommand: \"Command `%{command}` has no subcommands.\"\n\ncommand_error:\n  bad_argument: \"One or more arguments are incorrect.\\nTry \\n```\\n%{command_usage}\\n```\\nFor more information on usage, send\\n```\\n%{help_command}\\n```\"\n  missing_argument: \"One or more arguments are missing.\\nTry \\n```\\n%{command_usage}\\n```\\nFor more information on usage, send\\n```\\n%{help_command}\\n```\"\n  not_found: \"Sorry, I couldn't find anything that matched what you indicated.\"\n  exception: \"An exceptional error has occurred. The bug has been automatically reported, please be patient. Detail of the error :```\\nFile '%{file}', line '%{line}', command '%{command}'\\n%{error}: %{error_message}\\n```\"\n  invite_message: \"A bug has occurred. This invitation will allow, if needed, the developer to access the server, to understand why the bug occurred. This invitation is limited to one use, grants only the status of temporary member, and lasts maximum 1 day.\"\n  on_cooldown: \"This command is on cooldown. Try again %{cooldown_time}.\"\n  invalid_quoted_string: \"Sorry, but I couldn't correctly process the arguments. Maybe you forgot to put a space after a closing quote ?\"\n  bot_missing_permission: \"I do not have the necessary permissions to perform this action (role not high enough or permission not granted)\"\n  user_missing_permission: \"You do not have the necessary permissions to perform this action (role not high enough or permission not granted)\"\n  private_message_only: \"This command can only be used in private messages.\"\n  no_private_message: \"This command cannot be used in private messages.\"\n\napp_error:\n  transformer: \"The argument `%{argument_value}` is incorrect.\\nTry \\n```\\n%{command_usage}\\n```\\nFor more information on usage, send\\n```\\n%{help_command}\\n```\"\n  no_private_message: \"This command cannot be used in private messages.\"\n  missing_role: \"You need the role `%{role}` to use this command.\"\n  missing_any_role: \"You need one of the following roles to use this command: `%{roles_list}`.\"\n  missing_permissions: \"You need the following permissions to use this command: `%{permissions_list}`.\"\n  bot_missing_permissions: \"I need the following permissions to use this command: `%{permissions_list}`.\"\n  on_cooldown: \"This command is on cooldown. Try again %{cooldown_time}.\"\n  command_not_found: \"Command not found, please refresh your discord client.\"\n```\n\n\u003e The localisations provided here are the default one, and are used if they're not provided in the locale file.\n\n## List of variables contained in the configuration file\n\n- `prefix`: the bot's command prefix\n- `token`: the token of the bot (required)\n- `description`: the description of the bot, if any\n- `version`: the version of the bot, if any\n- `color`: the color that should be used in embeds, if any\n- `help_cog`: the name of the cog containing the help command. If not provided, no cog will be assigned.\n- `hot_reload`: whether or not the bot should reload the cogs when they are modified. Also describe if\n  localisations should be loaded from memory or from the disk.\n- `auto_sync`: whether or not the bot should automatically sync the slash commands at startup (avoid if possible)\n- `case_insensitive`: whether the prefix and the commands should be case insensitive (e.g. `!ping` and `!PING` are\n  equivalent)\n- `locale`: The default locale of the bot, if none is found at the command's call\n- `help` : the help command's configuration - below configuration is a non-exhaustive list of the available options\n  (passed as kwargs to the `HelpCommand` constructor)\n    - `cog`: the name of the cog to which the command should belong, if any. Correspond to the class name\n    - `name`: the name of the help command\n    - `help`: the help message for the help command\n    - `description`: the description of the help command\n    - `usage`: the usage of the help command\n    - `brief`: the short description of the help command\n    - `aliases`: the aliases of the help command\n    - `cooldown`: the cooldown of the help command\n    - `enabled`: whether the help command should be enabled\n    - `hidden`: whether the help command should be hidden\n- `log`\n    - `channel`: the channel where the information and errors should be logged, if any (int)\n    - `file`: the file where the information and errors should be logged, if any\n    - `alert_user`: whether the bot should send a message to the user that called the command if a code-related error\n      occurred\n    - `commands`: (deprecated) whether the commands (reception/completion) should be logged. This doesn't affect \n      command errors, which are always logged\n    - `stream`: whether the logs should be streamed to the console or not\n    - `level`: the level of logs to be displayed in the console. Can be one\n      of `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`\n    - `root`: whether the whole hierarchy of the bot should be logged\n    - `stream_to_err`: whether the logs should be streamed to the error stream (`stderr`) or the output\n      stream (`stdout`)\n      (if `stream` is `true`)\n    - `format`: the format of the logs. The following variables can (but don't have to) be used:\n        - `{asctime}`: the date and time of the log\n        - `{name}`: the name of the logger\n        - `{levelname}`: the level of the log\n        - `{message}`: the message of the log\n        - `{levelformat}`: the level of the log, formatted according to the `level_format` variable\n    - `date_format`: the format of the date and time of the log\n    - `level_format`:\n        - `debug`: the format of the debug level\n        - `info`: the format of the info level\n        - `warning`: the format of the warning level\n        - `error`: the format of the error level\n        - `critical`: the format of the critical level\n- `override_config`: the name of the file containing the override configuration, if any\n\n## List of localisation variables\n\n- `help`\n    - `no_commands`: the message that should appear when there is no commands in the bot, cog or group\n    - `bot`\n        - `title`: the title that should appear at the top of the help message\n        - `description`: the description of the help message. Can be information on his usages.  `%{help_command}` is\n          the invocation of the help command\n        - `no_category`: the title that should appear on top of the 'No cog-related' section\n    - `cog`\n        - `title`: the title that should appear at the top of the help message related to a cog. `%{cog}` is the name of\n          the\n          cog\n        - `commands`: the of the commands section\n    - `group`\n        - `title`: the title that should appear at the top of the help message related to a command group. `%{group}` is\n          the\n          name of the command group\n    - `command`\n        - `title`: the title that should appear at the top of the help message related to a command. `%{command}` is the\n          name of the command\n        - `not_found`: the message that should appear if no command corresponding to a name is found. `%{command}` is\n          the\n          name of the searched command\n    - `subcommand`\n        - `not_found`: the message that should appear if no subcommand of a command corresponding to a name is found.\n          `%{command}` is the name of the searched command, `%{subcommand}` of the searched subcommand\n        - `no_subcommand`: the message that should appear if a command doesn't have any subcommand. `%{command}` is the\n          name\n          of the command\n- `command_error`\n    - `bad_argument`: the message that should be sent if a command is used with the wrong arguments. `%{command_usage}`\n      is\n      the command signature, `%{help_command}` is the help command to get help on this command\n    - `missing_argument`: the message that should be sent if a command is used with not enough arguments.\n      `%{command_usage}` is the command signature, `%{help_command}` is the help command to get help on this command\n    - `not_found`: the message that should be sent if a command is used with unknown arguments (ex: discord member that\n      doesn't exist)\n    - `exception`: the message that should be sent if a command raises an internal error. `%{file}` is the file where\n      the\n      error has been raised, `%{line}` is the line where the error has been raised, `%{command}` is the name of the\n      command, `%{error}` is the error type, `%{error_message}` is the error message\n    - `invite_message`: the message that should be used as a reason to justify the creation of an invitation to the\n      server where the bug as been raised\n    - `on_cooldown`: the message that should be sent if a command is used while it is on cooldown. `%{cooldown_time}` is\n      the cooldown duration in seconds\n    - `invalid_quoted_string`: the message that should be sent if a quoted string is badly or not closed\n    - `bot_missing_permission`: the message that should be sent if the bot doesn't have the necessary rights to execute\n      this command\n    - `user_missing_permission`: the message that should be sent if the user that called the command doesn't have the\n      necessary rights to use this command\n- `app_error`\n    - `transformer`: the message that should be sent if a transformer raises an error. `%{argument_value}` is the value\n      that has been passed to the transformer, `%{command_usage}` is the command signature, `%{help_command}` is the\n      help\n      of the command\n    - `no_private_message`: the message that should be sent if a command is used in a private message and can't be used\n      in this context\n    - `missing_role`: the message that should be sent if a command is used by a user that doesn't have the necessary\n      role to use this command. `%{role}` is the name of the role\n    - `missing_any_role`: the message that should be sent if a command is used by a user that doesn't have any of the\n      necessary roles to use this command. `%{roles_list}` is the list of the roles\n    - `missing_permissions`: the message that should be sent if a command is used by a user that doesn't have the\n      necessary permissions to use this command. `%{permissions_list}` is the list of the permissions\n    - `bot_missing_permissions`: the message that should be sent if the bot doesn't have the necessary permissions to\n      execute this command. `%{permissions_list}` is the list of the permissions\n    - `cooldown`: the message that should be sent if a command is used while it is on cooldown. `%{cooldown_time}` is\n      the cooldown duration in seconds\n    - `command_not_found`: the message that should be sent if a command doesn't exist but is still cached and called by\n      a\n      discord client\n\n## Links\n\n- [Github](https://github.com/Kyrela/discore)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyrela%2Fdiscore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyrela%2Fdiscore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyrela%2Fdiscore/lists"}