Skip to content

Commit

Permalink
Merge pull request #16 from Yang-33/master
Browse files Browse the repository at this point in the history
Ojisan could be seriously.
  • Loading branch information
greymd authored Jun 1, 2019
2 parents ce2e59a + 9542291 commit 42f84af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pattern/tags.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ func ConvertTags(message, targetName string, emojiNumber int) string {
for tag, pat := range flexTags {
n := strings.Count(message, tag)
for i := 0; i < n; i++ {
content := combineMultiplePatterns(pat, rand.Intn(emojiNumber)+1)
content := ""
if emojiNumber > 0 {
content = combineMultiplePatterns(pat, rand.Intn(emojiNumber) + 1)
} else {
// Ojisan could be seriously
content = "。"
}
// タグを置換
message = strings.Replace(message, tag, content, 1)
}
Expand Down

0 comments on commit 42f84af

Please sign in to comment.