A developer focused discord bot written in go
Install all go dependencies
go get ./...
Copy .env.sample
to .env
and add secrets
cp .env.sample .env
Install godotenv
go install github.com/joho/godotenv/cmd/godotenv@latest
Run the following command to run the application.
godotenv -f .env go run cmd/bot/main.go
- Go v1.17
- Discord
- Fork the project
- Push changes
- Create a PR and add reveiwers
Note: If you grab an issue that is labled TODO, please delete the TODO comment.
If you are adding a test please make sure to delete any of the todo comment once you push your changes
// TODO Tests: GetFirstContributionYearByUsername // labels: tests func TestGetFirstContributionYearByUsername(t *testing.T) { } // TODO Tests: GetFirstContributionYearByUsername // labels: tests func TestGetFirstContributionYearByUsername(t *testing.T) { }
// function to test func (g *GithubService) GetContributionsByUsername() { // logic } // notice the naming for the main test for GetContributionsByUsername // the struct followed but a single underscore and the receiver method name func TestGithubService_GetContributionsByUsername(t *testing.T) { // test } // test modifiers are separated by a double underscore followed by what you are testing for func TestGithubService_GetContributionsByUsername__MultiYear(t *testing.T) { // test }
Run the command below to mock all of your interfaces
Pull mockery docker image
docker pull vektra/mockery
Run this in devy, replace pwd with root pwd
docker run -v "$PWD":/src -w /src vektra/mockery --all
For in package
docker run -v "$PWD":/src -w /src vektra/mockery --all --inpackage
If you need to monkey patch or create pointer functions follow this convention
// keep the pointer functions at the top of the file var ( doSomethingF = doSomething ) // make sure in the implementation you call the pointer func GetContributionsByUsername() { something, err := doSomethingF(args) } // now you can mock that function func TestGetContributionsByUsername(t *testing.T) { doSomethingF = func(args) (something, error) { return something, err } }
- Forces you to change nick name to real name
- Displays github data
- Gives us newest fireship videos
- Scrapes for new changes to certain lang's
- Coding challenges and scoreboards
- Maybe something with leetcode
- New Job openings for those looking for a new job
Error displaying in console
YYYY/MM/DD hh:mm:ss error closing resp body