Skip to content

Commit e233895

Browse files
author
George Gabolaev
authored
Merge pull request #6 from gabolaev/master
DmitryDorofeev/goicqbot -> mail-ru-im/bot-golang
2 parents 7b1432c + a2a4fb5 commit e233895

19 files changed

+117
-112
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<img src="https://github.com/mail-ru-im/bot-python/blob/master/logo.png" width="100" height="100">
22

3-
# Golang interface for ICQ bot API
3+
# Golang interface for bot API
44
[![CircleCI](https://circleci.com/gh/DmitryDorofeev/goicqbot.svg?style=svg)](https://circleci.com/gh/DmitryDorofeev/goicqbot)
55

66
- *Brand new Bot API!*
@@ -11,7 +11,7 @@
1111

1212
## Install
1313
```bash
14-
go get github.com/DmitryDorofeev/goicqbot
14+
go get github.com/mail-ru-im/bot-golang
1515
```
1616

1717
## Usage
@@ -25,10 +25,10 @@ Note a bot can only reply after the user has added it to his contacts list, or i
2525
```go
2626
package main
2727

28-
import "github.com/DmitryDorofeev/goicqbot"
28+
import "github.com/mail-ru-im/bot-golang"
2929

3030
func main() {
31-
bot, err := goicqbot.NewBot(BOT_TOKEN)
31+
bot, err := botgolang.NewBot(BOT_TOKEN)
3232
if err != nil {
3333
log.Println("wrong token")
3434
}
@@ -75,13 +75,12 @@ You don't need this.
7575
But if you do, you can override bot's API URL:
7676

7777
```go
78-
bot := goicqbot.NewBot(BOT_TOKEN, goicqbot.BotApiURL("https://agent.mail.ru/bot/v1"))
78+
bot := botgolang.NewBot(BOT_TOKEN, botgolang.BotApiURL("https://agent.mail.ru/bot/v1"))
7979
```
80-
8180
And debug all api requests and responses:
8281

8382
```go
84-
bot := goicqbot.NewBot(BOT_TOKEN, goicqbot.BotDebug(true))
83+
bot := botgolang.NewBot(BOT_TOKEN, botgolang.BotDebug(true))
8584
```
8685

8786

api_mock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goicqbot
1+
package botgolang
22

33
import (
44
"encoding/json"

bot.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package goicqbot
1+
package botgolang
22

33
/*
4-
💥 GoICQBot is zero-configuration library with convenient interface.
4+
💥 botgolang is zero-configuration library with convenient interface.
55
Crafted with love in @mail for your awesome bots.
66
*/
77

@@ -18,7 +18,7 @@ const (
1818
defaultDebug = false
1919
)
2020

21-
// Bot is the main structure for interaction with ICQ API.
21+
// Bot is the main structure for interaction with API.
2222
// All fields are private, you can configure bot using config arguments in NewBot func.
2323
type Bot struct {
2424
ctx context.Context
@@ -146,7 +146,7 @@ func (b *Bot) GetUpdatesChannel(ctx context.Context) <-chan Event {
146146
}
147147

148148
// NewBot returns new bot object.
149-
// All communications with ICQ bot API must go through Bot struct.
149+
// All communications with bot API must go through Bot struct.
150150
// In general you don't need to configure this bot, therefore all options are optional arguments.
151151
func NewBot(token string, opts ...BotOption) (*Bot, error) {
152152
logger := logrus.New()

chat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goicqbot
1+
package botgolang
22

33
//go:generate easyjson -all chat.go
44

chat_easyjson.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goicqbot
1+
package botgolang
22

33
import (
44
"bytes"

client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goicqbot
1+
package botgolang
22

33
import (
44
"net/http"

example/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
"os"
88
"time"
99

10-
"github.com/DmitryDorofeev/goicqbot"
10+
"github.com/mail-ru-im/bot-golang"
1111
)
1212

1313
func main() {
1414
token := os.Getenv("TOKEN")
1515

16-
bot, err := goicqbot.NewBot(token, goicqbot.BotDebug(true))
16+
bot, err := botgolang.NewBot(token, botgolang.BotDebug(true))
1717
if err != nil {
1818
log.Fatalf("cannot connect to bot: %s", err)
1919
}
@@ -53,12 +53,12 @@ func main() {
5353
for update := range updates {
5454
fmt.Println(update.Type, update.Payload)
5555
switch update.Type {
56-
case goicqbot.NEW_MESSAGE:
56+
case botgolang.NEW_MESSAGE:
5757
message := update.Payload.Message()
5858
if err := message.Send(); err != nil {
5959
log.Printf("something went wrong: %s", err)
6060
}
61-
case goicqbot.EDITED_MESSAGE:
61+
case botgolang.EDITED_MESSAGE:
6262
message := update.Payload.Message()
6363
message.Reply("do not edit!")
6464
}

file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package goicqbot
1+
package botgolang
22

33
//go:generate easyjson -all file.go
44

file_easyjson.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)