{"id":36591295,"url":"https://github.com/lni-dev/lapi","last_synced_at":"2026-01-14T02:14:29.143Z","repository":{"id":57733974,"uuid":"474657055","full_name":"lni-dev/lapi","owner":"lni-dev","description":"LApi is a Discord API written in Java","archived":true,"fork":false,"pushed_at":"2024-10-01T23:41:07.000Z","size":2151,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-12T16:27:28.228Z","etag":null,"topics":["discord-api","java","lapi"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lni-dev.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}},"created_at":"2022-03-27T14:11:05.000Z","updated_at":"2025-03-23T16:37:55.000Z","dependencies_parsed_at":"2023-01-30T19:45:22.465Z","dependency_job_id":null,"html_url":"https://github.com/lni-dev/lapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lni-dev/lapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lni-dev%2Flapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lni-dev%2Flapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lni-dev%2Flapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lni-dev%2Flapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lni-dev","download_url":"https://codeload.github.com/lni-dev/lapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lni-dev%2Flapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["discord-api","java","lapi"],"created_at":"2026-01-12T08:15:54.292Z","updated_at":"2026-01-14T02:14:29.137Z","avatar_url":"https://github.com/lni-dev.png","language":"Java","readme":"# LApi \n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lni-dev/lapi/codeql-analysis.yml?branch=master)\n![Maven Central](https://img.shields.io/maven-central/v/io.github.lni-dev/lapi?color=%2300dd00)\n![Lines of code](https://img.shields.io/tokei/lines/github/lni-dev/lapi)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/lni-dev/lapi)\n\u003cbr\u003eLApi is a Discord API written in Java\n\u003cbr\u003e\u003cbr\u003e\n\nAchived: No further development.\n\n## Installation ![Maven Central](https://img.shields.io/maven-central/v/io.github.lni-dev/lapi?label=current%20newest%20version%3A%20)\nIn order to install it, you can either build it yourself or use gradle and implement it into your Project:\u003cbr\u003e\u003cbr\u003e\nIn your `build.gradle` add `mavenCentral()` to the repositories if you have not done so already and add the following two dependencies. Replace `[version]` with the version you want to install.\n \u003cbr\u003e\u003cbr\u003e\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    annotationProcessor 'io.github.lni-dev:lapi-annotation-processor:1.0.1'\n    implementation 'io.github.lni-dev:lapi:[version]'\n}\n```\n\n\u003cbr\u003eAn example `build.gradle` could look like this:\n```groovy\nplugins {\n    id 'java'\n}\n\ngroup 'com.example'\nversion 'your.version'\n\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    annotationProcessor 'io.github.lni-dev:lapi-annotation-processor:1.0.1'\n    implementation 'io.github.lni-dev:lapi:1.0.4'\n}\n```\n(Tested on gradle 7.5.1)\n\n\u003cbr\u003eIf you want to make an executable .jar file at some point in time, I recommend\nthe gradle plugins `application` and `shadow`. An example `build.gradle` with these plugins could\nlook like this:\n```groovy\nplugins {\n    id 'java'\n    id 'application'\n    id 'com.github.johnrengelman.shadow' version '7.1.2'\n}\n\ngroup 'com.example'\nversion '1.0.0'\nmainClassName = 'com.example.exampleProjectName.Main'\n\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    annotationProcessor 'io.github.lni-dev:lapi-annotation-processor:1.0.1'\n    implementation 'io.github.lni-dev:lapi:1.0.4'\n}\n```\nThis will then add a gradle task called shadowJar, which will build an executable jar for you.\n## Getting Started\nFirst you will need to create a Discord bot and copy it's `TOKEN`.\u003cbr\u003e\nThen you can create a Config:\n```java\nConfig config = ConfigBuilder.getDefault(\"TOKEN\", true).build();\n```\nAnd create a LApi instance:\n```java\nConfig config = ConfigBuilder.getDefault(\"TOKEN\", true).build();\nLApi lApi = LApi.newInstance(config);\n```\nOr a lot simpler:\n```java\nLApi lApi = ConfigBuilder.getDefault(\"TOKEN\", true).buildLApi();\n```\n`TOKEN` must be replaced with your bot token. The second boolean parameter specifies, whether\nyou want the privileged intents enabled. Read more [here](https://discord.com/developers/docs/topics/gateway#privileged-intents).\nIf you pass `true`, you have to enable them for your application's bot [here](https://discord.com/developers/applications).\n\u003cbr\u003e\u003cbr\u003e\nNow you can register an EventListener:\n```java\nlApi.getEventTransmitter().addListener(new EventListener() {\n    @Override\n    public void onMessageCreate(@NotNull LApi lApi, @NotNull MessageCreateEvent event) {\n        //code\n    }\n\n    @Override\n    public void onMessageUpdate(@NotNull LApi lApi, @NotNull MessageUpdateEvent event) {\n        //code\n    }\n\n    @Override\n    public void onMessageDelete(@NotNull LApi lApi, @NotNull MessageDeleteEvent event) {\n        //code\n    }\n});\n```\n\nInside your listener, you can overwrite all events, you want to listen to.\u003cbr\u003e\nHere a small example on how to respond to \"Hi\":\n```java\nlApi.getEventTransmitter().addListener(new EventListener() {\n    @Override\n    public void onMessageCreate(@NotNull LApi lApi, @NotNull MessageCreateEvent event) {\n        System.out.println(\"Message: \" + event.getMessage().getContent());\n\n        if(!event.getMessage().getAuthor().isBot() \u0026\u0026 event.getMessage().getContent().equals(\"Hi\")){\n            lApi.getRequestFactory().createMessage(event.getChannelId(), \"Hi\").queue();\n        }\n    }\n});\n```\nNote the check, if the message was sent by a bot. This check is important, so that your bot does not respond to itself.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flni-dev%2Flapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flni-dev%2Flapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flni-dev%2Flapi/lists"}