Skip to content

Commit 1f85967

Browse files
committed
Consistency of variable names.
1 parent 655c3a4 commit 1f85967

File tree

2 files changed

+186
-186
lines changed

2 files changed

+186
-186
lines changed

bot.go

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@ func (bot *BotAPI) GetUserProfilePhotos(config UserProfilePhotosConfig) (UserPro
329329
//
330330
// Requires FileID.
331331
func (bot *BotAPI) GetFile(config FileConfig) (File, error) {
332-
v := make(Params)
332+
params := make(Params)
333333

334-
v["file_id"] = config.FileID
334+
params["file_id"] = config.FileID
335335

336-
resp, err := bot.MakeRequest("getFile", v)
336+
resp, err := bot.MakeRequest("getFile", params)
337337
if err != nil {
338338
return File{}, err
339339
}
@@ -438,11 +438,11 @@ func (bot *BotAPI) ListenForWebhook(pattern string) UpdatesChannel {
438438

439439
// GetChat gets information about a chat.
440440
func (bot *BotAPI) GetChat(config ChatConfig) (Chat, error) {
441-
v := make(Params)
441+
params := make(Params)
442442

443-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
443+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
444444

445-
resp, err := bot.MakeRequest("getChat", v)
445+
resp, err := bot.MakeRequest("getChat", params)
446446
if err != nil {
447447
return Chat{}, err
448448
}
@@ -458,11 +458,11 @@ func (bot *BotAPI) GetChat(config ChatConfig) (Chat, error) {
458458
// If none have been appointed, only the creator will be returned.
459459
// Bots are not shown, even if they are an administrator.
460460
func (bot *BotAPI) GetChatAdministrators(config ChatConfig) ([]ChatMember, error) {
461-
v := make(Params)
461+
params := make(Params)
462462

463-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
463+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
464464

465-
resp, err := bot.MakeRequest("getChatAdministrators", v)
465+
resp, err := bot.MakeRequest("getChatAdministrators", params)
466466
if err != nil {
467467
return []ChatMember{}, err
468468
}
@@ -475,11 +475,11 @@ func (bot *BotAPI) GetChatAdministrators(config ChatConfig) ([]ChatMember, error
475475

476476
// GetChatMembersCount gets the number of users in a chat.
477477
func (bot *BotAPI) GetChatMembersCount(config ChatConfig) (int, error) {
478-
v := make(Params)
478+
params := make(Params)
479479

480-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
480+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
481481

482-
resp, err := bot.MakeRequest("getChatMembersCount", v)
482+
resp, err := bot.MakeRequest("getChatMembersCount", params)
483483
if err != nil {
484484
return -1, err
485485
}
@@ -492,12 +492,12 @@ func (bot *BotAPI) GetChatMembersCount(config ChatConfig) (int, error) {
492492

493493
// GetChatMember gets a specific chat member.
494494
func (bot *BotAPI) GetChatMember(config ChatConfigWithUser) (ChatMember, error) {
495-
v := make(Params)
495+
params := make(Params)
496496

497-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
498-
v.AddNonZero("user_id", config.UserID)
497+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
498+
params.AddNonZero("user_id", config.UserID)
499499

500-
resp, err := bot.MakeRequest("getChatMember", v)
500+
resp, err := bot.MakeRequest("getChatMember", params)
501501
if err != nil {
502502
return ChatMember{}, err
503503
}
@@ -511,50 +511,50 @@ func (bot *BotAPI) GetChatMember(config ChatConfigWithUser) (ChatMember, error)
511511
// UnbanChatMember unbans a user from a chat. Note that this only will work
512512
// in supergroups and channels, and requires the bot to be an admin.
513513
func (bot *BotAPI) UnbanChatMember(config ChatMemberConfig) (APIResponse, error) {
514-
v := make(Params)
514+
params := make(Params)
515515

516-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername, config.ChannelUsername)
517-
v.AddNonZero("user_id", config.UserID)
516+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername, config.ChannelUsername)
517+
params.AddNonZero("user_id", config.UserID)
518518

519-
return bot.MakeRequest("unbanChatMember", v)
519+
return bot.MakeRequest("unbanChatMember", params)
520520
}
521521

522522
// RestrictChatMember to restrict a user in a supergroup. The bot must be an
523523
//administrator in the supergroup for this to work and must have the
524524
//appropriate admin rights. Pass True for all boolean parameters to lift
525525
//restrictions from a user. Returns True on success.
526526
func (bot *BotAPI) RestrictChatMember(config RestrictChatMemberConfig) (APIResponse, error) {
527-
v := make(Params)
527+
params := make(Params)
528528

529-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername, config.ChannelUsername)
530-
v.AddNonZero("user_id", config.UserID)
529+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername, config.ChannelUsername)
530+
params.AddNonZero("user_id", config.UserID)
531531

532-
v.AddNonNilBool("can_send_messages", config.CanSendMessages)
533-
v.AddNonNilBool("can_send_media_messages", config.CanSendMediaMessages)
534-
v.AddNonNilBool("can_send_other_messages", config.CanSendOtherMessages)
535-
v.AddNonNilBool("can_add_web_page_previews", config.CanAddWebPagePreviews)
536-
v.AddNonZero64("until_date", config.UntilDate)
532+
params.AddNonNilBool("can_send_messages", config.CanSendMessages)
533+
params.AddNonNilBool("can_send_media_messages", config.CanSendMediaMessages)
534+
params.AddNonNilBool("can_send_other_messages", config.CanSendOtherMessages)
535+
params.AddNonNilBool("can_add_web_page_previews", config.CanAddWebPagePreviews)
536+
params.AddNonZero64("until_date", config.UntilDate)
537537

538-
return bot.MakeRequest("restrictChatMember", v)
538+
return bot.MakeRequest("restrictChatMember", params)
539539
}
540540

541541
// PromoteChatMember add admin rights to user
542542
func (bot *BotAPI) PromoteChatMember(config PromoteChatMemberConfig) (APIResponse, error) {
543-
v := make(Params)
543+
params := make(Params)
544544

545-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername, config.ChannelUsername)
546-
v.AddNonZero("user_id", config.UserID)
545+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername, config.ChannelUsername)
546+
params.AddNonZero("user_id", config.UserID)
547547

548-
v.AddNonNilBool("can_change_info", config.CanChangeInfo)
549-
v.AddNonNilBool("can_post_messages", config.CanPostMessages)
550-
v.AddNonNilBool("can_edit_messages", config.CanEditMessages)
551-
v.AddNonNilBool("can_delete_messages", config.CanDeleteMessages)
552-
v.AddNonNilBool("can_invite_members", config.CanInviteUsers)
553-
v.AddNonNilBool("can_restrict_members", config.CanRestrictMembers)
554-
v.AddNonNilBool("can_pin_messages", config.CanPinMessages)
555-
v.AddNonNilBool("can_promote_members", config.CanPromoteMembers)
548+
params.AddNonNilBool("can_change_info", config.CanChangeInfo)
549+
params.AddNonNilBool("can_post_messages", config.CanPostMessages)
550+
params.AddNonNilBool("can_edit_messages", config.CanEditMessages)
551+
params.AddNonNilBool("can_delete_messages", config.CanDeleteMessages)
552+
params.AddNonNilBool("can_invite_members", config.CanInviteUsers)
553+
params.AddNonNilBool("can_restrict_members", config.CanRestrictMembers)
554+
params.AddNonNilBool("can_pin_messages", config.CanPinMessages)
555+
params.AddNonNilBool("can_promote_members", config.CanPromoteMembers)
556556

557-
return bot.MakeRequest("promoteChatMember", v)
557+
return bot.MakeRequest("promoteChatMember", params)
558558
}
559559

560560
// GetGameHighScores allows you to get the high scores for a game.
@@ -577,11 +577,11 @@ func (bot *BotAPI) GetGameHighScores(config GetGameHighScoresConfig) ([]GameHigh
577577

578578
// GetInviteLink get InviteLink for a chat
579579
func (bot *BotAPI) GetInviteLink(config ChatConfig) (string, error) {
580-
v := make(Params)
580+
params := make(Params)
581581

582-
v.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
582+
params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)
583583

584-
resp, err := bot.MakeRequest("exportChatInviteLink", v)
584+
resp, err := bot.MakeRequest("exportChatInviteLink", params)
585585
if err != nil {
586586
return "", err
587587
}

0 commit comments

Comments
 (0)