{"id":19640163,"url":"https://github.com/gearplug/gp-discord-python","last_synced_at":"2025-10-26T04:17:34.799Z","repository":{"id":235896835,"uuid":"791483417","full_name":"GearPlug/gp-discord-python","owner":"GearPlug","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-25T14:42:31.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-13T21:01:57.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/GearPlug.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}},"created_at":"2024-04-24T19:56:08.000Z","updated_at":"2024-04-25T14:42:43.000Z","dependencies_parsed_at":"2024-04-25T15:47:02.166Z","dependency_job_id":"f84b5cbb-01e8-4073-babe-0cf504a00175","html_url":"https://github.com/GearPlug/gp-discord-python","commit_stats":null,"previous_names":["gearplug/discord-python","gearplug/discord-api-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GearPlug/gp-discord-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fgp-discord-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fgp-discord-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fgp-discord-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fgp-discord-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GearPlug","download_url":"https://codeload.github.com/GearPlug/gp-discord-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GearPlug%2Fgp-discord-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281056544,"owners_count":26436605,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"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":[],"created_at":"2024-11-11T14:04:51.314Z","updated_at":"2025-10-26T04:17:34.767Z","avatar_url":"https://github.com/GearPlug.png","language":"Python","readme":"\n# gp-discord-python\n![](https://img.shields.io/badge/version-0.1.0-success) ![](https://img.shields.io/badge/Python-3.8%20|%203.9%20|%203.10%20|%203.11-4B8BBE?logo=python\u0026logoColor=white)  \n\n*gp-discord-python* is an API wrapper for Discord, written in Python.  \nThis library uses Oauth2 for authentication.\n## Installing\n```\npip install gp-discord-python\n```\n### Usage\n```python\nfrom discord.client import Client\nclient = Client(\"YOUR_CLIENT_ID\", \"YOUR_CLIENT_SECRET\")\nclient.set_bot_token(\"YOUR_BOT_TOKEN\")\n```\nTo obtain and set an access token, follow this instructions:\n1. **Get authorization URL**\n```python\nurl = client.authorization_url(redirect_uri=\"YOUR_REDIRECT_URI\")\n# This call generates the url necessary to display the pop-up window to perform oauth authentication\n# param redirect_uri is required oauth request.\n```\n2. **Get access token using code**\n```python\ntoken = client.exchange_code(\"YOUR_CODE\")\n# \"code\" is the same response code after login with oauth with the above url.\n```\n\n3. **Refresh access token using refresh_token**\n```python\ntoken = client.refresh_token(\"YOUR_REFRESH_TOKEN\")\n# \"refresh_token\" is the token refresh in response after login with oauth with the above url.\n```\n\n## Actions\n\n#### - Get user info\n```python\nclient.get_user_info()\n# Get the info for current user.\n```\n#### - Get by URL\n```python\nclient.get_by_url(url=\"YOUR_URL\")\n# Get data for any other URL from Discord API.\n```\n#### - List of channels\n```python\nclient.get_channel_list(guild_id=\"YOUR_GUILD_ID\")\n# Get data list for all channels in server account connected\n# param guild_id is in the response of access token after exchange code authorization.\n```\n#### - Get messages\n```python\nclient.get_messages(channel_id=\"YOUR_CHANNEL_ID\")\n# Get data list for all messages in a channel from server account connected\n# param channel_id is in the response of list of channels action's.\n```\n\n#### - Send message\n\n```python\nimport json\n\nclient.send_messages(\n    channel_id=\"YOUR_CHANNEL_ID\", \n    data=json.dumps({\"content\": \"YOUR_MESSAGE_HERE\"})\n)\n# Send message to channel from server account connected\n# param channel_id is in the response of list of channels action's.\n# param data is the content of message in format json\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Fgp-discord-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgearplug%2Fgp-discord-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgearplug%2Fgp-discord-python/lists"}