{"id":21992772,"url":"https://github.com/pinpox/matrix-bot","last_synced_at":"2025-04-30T14:25:36.465Z","repository":{"id":57509206,"uuid":"181366813","full_name":"pinpox/matrix-bot","owner":"pinpox","description":":beer: :fax: *BYOB* (Build your own bot) - Build a matrix bot that acts on !commands","archived":false,"fork":false,"pushed_at":"2023-07-13T16:24:38.000Z","size":65,"stargazers_count":23,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T14:25:27.165Z","etag":null,"topics":["bot","chat","chatbot","golang","matrix-org"],"latest_commit_sha":null,"homepage":"https://pablo.tools","language":"Go","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/pinpox.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}},"created_at":"2019-04-14T20:43:53.000Z","updated_at":"2024-12-22T06:18:47.000Z","dependencies_parsed_at":"2022-08-30T07:10:45.938Z","dependency_job_id":null,"html_url":"https://github.com/pinpox/matrix-bot","commit_stats":null,"previous_names":["binaryplease/matrix-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinpox%2Fmatrix-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinpox%2Fmatrix-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinpox%2Fmatrix-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinpox%2Fmatrix-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinpox","download_url":"https://codeload.github.com/pinpox/matrix-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251720963,"owners_count":21632745,"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","chat","chatbot","golang","matrix-org"],"created_at":"2024-11-29T20:14:51.161Z","updated_at":"2025-04-30T14:25:36.433Z","avatar_url":"https://github.com/pinpox.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/pinpox/matrix-bot.svg?branch=master)](https://travis-ci.org/pinpox/matrix-bot)\n[![GoDoc](https://godoc.org/github.com/pinpox/matrix-bot?status.svg)](https://godoc.org/github.com/pinpox/matrix-bot)\n[![Go Report Card](https://goreportcard.com/badge/github.com/pinpox/gitea-matrix-bot)](https://goreportcard.com/report/github.com/pinpox/matrix-bot)\n[![codecov](https://codecov.io/gh/pinpox/matrix-bot/branch/master/graph/badge.svg)](https://codecov.io/gh/pinpox/matrix-bot)\n![Matrix](https://img.shields.io/matrix/matrix-bot:matrix.org.svg?label=%23matrix-bot%3Amatrix.org)\n\n\n# matrix-bot\nBYOB (Build your own bot) - Build a matrix bot that acts on !commands\n![screenshot](scrot.png \"Screenshot\")\n\n## Usage\nHere is a minimal example on how to build a custom bot that replies to a message \"!ping\" with \"pong\".\nAfter starting it, you can invite it to any matrix room and it will join.\n\n\n```go\npackage main\n\nimport \t\"github.com/pinpox/matrix-bot\"\n\n// PingPongBot is a custom bot that will reply to !ping with \"pong\"\ntype PingPongBot struct {\n\t*matrixbot.MatrixBot\n}\n\nfunc main() {\n\n\tpass := \"supersecretpass\"\n\tuser := \"myawesomebot\"\n\n\tbot, err := matrixbot.NewMatrixBot(user, pass)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tmypingPongBot := PingPongBot{bot}\n  \n        // Register a command like this\n\tbot.RegisterCommand(\"!ping\", 0, mypingPongBot.handlePing)\n\n\tfor {\n\t\t//Loop forever. If you don't have anything that keeps running, the bot will exit.\n\t}\n}\n\n// Handles the !ping message\nfunc (mybot *PingPongBot) handlePing(message, room, sender string) {\n\tmybot.SendToRoom(room, \"pong!\")\n}\n\n```\n\nFor a more complete example you can look at the [Gitea Matrix Bot](https://github.com/pinpox/gitea-matrix-bot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinpox%2Fmatrix-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinpox%2Fmatrix-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinpox%2Fmatrix-bot/lists"}