{"id":21346881,"url":"https://github.com/queer/yangmal","last_synced_at":"2025-03-16T03:44:06.122Z","repository":{"id":94882413,"uuid":"169721970","full_name":"queer/yangmal","owner":"queer","description":"양말 means \"socks.\" Typesafe commands for catnip","archived":false,"fork":false,"pushed_at":"2020-09-13T15:46:57.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T14:55:43.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/queer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-02-08T11:00:33.000Z","updated_at":"2020-09-13T15:46:59.000Z","dependencies_parsed_at":"2023-07-29T17:00:44.030Z","dependency_job_id":null,"html_url":"https://github.com/queer/yangmal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Fyangmal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Fyangmal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Fyangmal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/queer%2Fyangmal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/queer","download_url":"https://codeload.github.com/queer/yangmal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822277,"owners_count":20353499,"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":[],"created_at":"2024-11-22T02:11:50.006Z","updated_at":"2025-03-16T03:44:06.103Z","avatar_url":"https://github.com/queer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 양말\n\n\"양말\" means \"socks\" in Korean. Love you @natanbc \u003c33\n\n양말 is a command library for catnip.\n\n## Building\n\nJust run `mvn clean package`.\n\n## Usage\n\nDefault prefix is `!`.\n\n```Java\nfinal class README {\n    private README() {}\n    public static void main(final String[] args) {\n        final Catnip catnip = Catnip.catnip(\"token\");\n        catnip.loadExtension(\n            new Yangmal()\n                // If you just want to always use the same prefix everywhere\n                .constantPrefix(\"!!\")\n                // Alternatively, you can use the message to help determine the prefix.\n                // Prefix suppliers are called asynchronously.\n                .prefixSupplier(msg -\u003e {\n                    return database.getPrefixAsync(msg.guildId());\n                })\n                // Hooks populate the context with whatever data you think you'll need:\n                // user, guild, member, channel, stuff from your database, ...\n                // Hooks are called asynchronously.\n                .addContextHook((ctx, msg) -\u003e {\n                    return database.getSomething(msg.author())\n                            .thenAccept(thing -\u003e ctx.param(\"thing\", thing));\n                })\n                // Command checks are whether or not the command can be run. They get\n                // whatever data you pass in the context, and determine whether the\n                // command should be run or not\n                // Checks are called asynchronously\n                .addCommandCheck(ctx -\u003e {\n                    return someAsynchronousThing(ctx.param(\"thing\"));\n                })\n                // Type converters\n                .registerTypeConverter()\n                // Handle errors during command parsing, ex. if you want errors to go\n                // to your Sentry.io instance\n                // You guessed it, asynchronous\n                .errorHandler(e -\u003e {\n                    Sentry.capture(e);\n                })\n                // Handle commands that aren't found. Does nothing by default.\n                // Guess what? Async!\n                .invalidCommandHandler((name, ctx) -\u003e {\n                    logger.warn(\"Couldn't find command: {}\", name);\n                })\n                // Handle messages that aren't commands\n                .notCommandHandler(msg -\u003e {\n                    chatLevels.process(msg);\n                })\n                // Handled command checks that don't pass\n                .checksFailedHandler((msg, name, ctx) -\u003e {\n                    logger.warn(\"Command checks failed for command {}\", name);\n                })\n                // Finally, load all the commands and register catnip listeners\n                .setup()\n        );\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueer%2Fyangmal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqueer%2Fyangmal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueer%2Fyangmal/lists"}