{"id":48498612,"url":"https://github.com/kz/discordrus","last_synced_at":"2026-04-07T13:32:33.041Z","repository":{"id":57479889,"uuid":"82241555","full_name":"kz/discordrus","owner":"kz","description":"A Discord hook for sirupsen/logrus","archived":false,"fork":false,"pushed_at":"2021-03-11T12:39:56.000Z","size":20,"stargazers_count":28,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-06T21:18:05.602Z","etag":null,"topics":["discord","logrus"],"latest_commit_sha":null,"homepage":"","language":"Go","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/kz.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":"2017-02-17T00:59:33.000Z","updated_at":"2024-01-22T07:29:50.000Z","dependencies_parsed_at":"2022-09-26T17:41:33.338Z","dependency_job_id":null,"html_url":"https://github.com/kz/discordrus","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kz/discordrus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kz%2Fdiscordrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kz%2Fdiscordrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kz%2Fdiscordrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kz%2Fdiscordrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kz","download_url":"https://codeload.github.com/kz/discordrus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kz%2Fdiscordrus/sbom","scorecard":{"id":575819,"data":{"date":"2025-08-11","repo":{"name":"github.com/kz/discordrus","commit":"25eeb0bfd79228e7f4c2491978efb290c47f00dc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 3/23 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T17:42:13.342Z","repository_id":57479889,"created_at":"2025-08-20T17:42:13.342Z","updated_at":"2025-08-20T17:42:13.342Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31515144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","logrus"],"created_at":"2026-04-07T13:32:30.339Z","updated_at":"2026-04-07T13:32:33.027Z","avatar_url":"https://github.com/kz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# discordrus | a [Discord](https://discordapp.com/) hook for [Logrus](https://github.com/Sirupsen/logrus) \u003cimg src=\"http://i.imgur.com/hTeVwmJ.png\" width=\"40\" height=\"40\" alt=\":walrus:\" class=\"emoji\" title=\":walrus:\"/\u003e [![Travis CI](https://api.travis-ci.org/kz/discordrus.svg?branch=master)](https://travis-ci.org/kz/discordrus) [![GoDoc](https://godoc.org/github.com/puddingfactory/logentrus?status.svg)](https://godoc.org/github.com/kz/discordrus)\n\n![Screenshot of discordrus in action](https://i.imgur.com/wuB480O.png)\n\n## Install\n\n`go get github.com/kz/discordrus`\n\n## Setup\n\nIn order to use this package, a Discord webhook URL is required. Find out how to obtain one [here](https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks). You will need to be a server administrator to do this.\n\n## Usage\n\nBelow is an example of how this package may be used. The options below are used only for the purpose of demonstration and chances are that you will not need to use any options at all (or if any, only the `Username` option).\n\n\n```go\npackage main\n\nimport (\n\t\"github.com/sirupsen/logrus\"\n\t\"os\"\n\t\"github.com/kz/discordrus\"\n)\n\nfunc init() {\n\tlogrus.SetFormatter(\u0026logrus.TextFormatter{})\n\tlogrus.SetOutput(os.Stderr)\n\tlogrus.SetLevel(logrus.TraceLevel)\n\n\tlogrus.AddHook(discordrus.NewHook(\n\t\t// Use environment variable for security reasons\n\t\tos.Getenv(\"DISCORDRUS_WEBHOOK_URL\"),\n\t\t// Set minimum level to DebugLevel to receive all log entries\n\t\tlogrus.TraceLevel,\n\t\t\u0026discordrus.Opts{\n\t\t\tUsername:           \"Test Username\",\n\t\t\tAuthor:             \"\",                         // Setting this to a non-empty string adds the author text to the message header\n\t\t\tDisableTimestamp:   false,                      // Setting this to true will disable timestamps from appearing in the footer\n\t\t\tTimestampFormat:    \"Jan 2 15:04:05.00000 MST\", // The timestamp takes this format; if it is unset, it will take logrus' default format\n\t\t\tTimestampLocale:    nil,                        // The timestamp uses this locale; if it is unset, it will use time.Local\n\t\t\tEnableCustomColors: true,                       // If set to true, the below CustomLevelColors will apply\n\t\t\tCustomLevelColors: \u0026discordrus.LevelColors{\n\t\t\t\tTrace: 3092790,\n\t\t\t\tDebug: 10170623,\n\t\t\t\tInfo:  3581519,\n\t\t\t\tWarn:  14327864,\n\t\t\t\tError: 13631488,\n\t\t\t\tPanic: 13631488,\n\t\t\t\tFatal: 13631488,\n\t\t\t},\n\t\t\tDisableInlineFields: false, // If set to true, fields will not appear in columns (\"inline\")\n\t\t},\n\t))\n}\n\nfunc main() {\n\tlogrus.WithFields(logrus.Fields{\"String\": \"hi\", \"Integer\": 2, \"Boolean\": false}).Debug(\"Check this out! Awesome, right?\")\n}\n```\n\nAll discordrus.Opts fields are optional.\n\nOption | Description | Default | Valid options\n--- | --- | --- | ---\nUsername | Replaces the default username of the webhook bot for the sent message only | Username unchanged | Any non-empty string (2-32 chars. inclusive)\nAuthor | Adds an author field to the header if set | Author not set | Any non-empty string (1-256 chars inclusive)\nDisableInlineFields | Inline means whether Discord will display the field in a column (with maximum three columns to a row). Setting this to `true` will cause Discord to display the field in its own row. | false | bool \nDisableTimestamp | Specifies whether the timestamp in the footer should be disabled | false | bool\nTimestampFormat | Change the timestamp format | logrus's default time format | `\"Jan 2 15:04:05.00000 MST\"`, or any format accepted by Golang\nTimestampLocale | Change the timestamp locale | `nil` | nil == time.Local, time.UTC, time.LoadLocation(\"America/New_York\"), etc\nEnableCustomColors | Specifies whether the `CustomLevelColors` opt value should be used instead of `discordrus.DefaultLevelColors`. If `true`, `CustomLevelColors` must be specified (or all colors will be set to the nil value of `0`, therefore displayed as white) | false | bool\nCustomLevelColors | Replaces `discordrus.DefaultLevelColors`. All fields must be entered or they will default to the nil value of `0`. | Pointer to struct instance of `discordrus.LevelColors`\n\t\nIn addition to the above character count constraints, Discord has a maximum of 25 fields with their name and value limits being 256 and 1024 respectively. Furthermore, the description (i.e., logrus' error message) must be a maximum of 2048. All of these constraints, including the option constraints above, will automatically be truncated with no further action required.\n\n## Contributing\n\nContributions are valued and welcome! Please feel free to open an issue or make a pull request.\n \n## Acknowledgements\nThe following repositories have been helpful in creating this package: [puddingfactory/logentrus](https://github.com/puddingfactory/logentrus) for Logentries, [johntdyer/slackrus](https://github.com/johntdyer/slackrus) for Slack and [nubo/hiprus](https://github.com/nubo/hiprus) for Hipchat. Check them out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkz%2Fdiscordrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkz%2Fdiscordrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkz%2Fdiscordrus/lists"}