Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

メッセージ送信部の分離 #29

Open
NolaTA3141592 opened this issue May 10, 2024 · 0 comments
Open

メッセージ送信部の分離 #29

NolaTA3141592 opened this issue May 10, 2024 · 0 comments

Comments

@NolaTA3141592
Copy link
Owner

if jsonbody2["type"] == "message" {
	user := slacktool.User {
		UserID: jsonbody2["user"].(string),
	}
	slack.AttachUserInfo(&user)
	if err != nil {
		http.Error(w, "Failed to get user info", http.StatusInternalServerError)
		return
	}
	dr.Bot.ChannelMessageSend(test_channel_id, fmt.Sprintf("[%s]: %s", user.RealName, jsonbody2["text"]))
}

この部分を関数に分離してほしい

将来的に、アイコンを取得する・名前をとってくる・jsonbody2["type"] != "message"(リアクションなど?)の場合 などがあり、大きくなってしまうため

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant