Skip to content

Commit cbdc264

Browse files
committed
Update README with adding custom emojies
1 parent 885691a commit cbdc264

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,36 @@ To validate, you'll need both the `OTP` and the generator
136136
ok := gen.Validate(otp.String())
137137
```
138138

139+
### emojies
140+
141+
To use your own set of **known** emojies, you can reference the [`cat`-emojies](moths/emojies/cats.go).
142+
143+
I've chosen the `cats.go` as it's a great reference, both for creating and re-using.
144+
145+
If the `cats`-slice didn't exist, we could remake it as:
146+
147+
```go
148+
// A slice of cat emojies and a single hotdog 🌭
149+
var catsHotdog = []string{
150+
emoji.GrinningCat.String(),
151+
emoji.GrinningCatWithSmilingEyes.String(),
152+
emoji.CatWithTearsOfJoy.String(),
153+
emoji.SmilingCatWithHeartEyes.String(),
154+
emoji.CatWithWrySmile.String(),
155+
emoji.KissingCat.String(),
156+
emoji.WearyCat.String(),
157+
emoji.CryingCat.String(),
158+
emoji.PoutingCat.String(),
159+
emoji.HotDog.String(),
160+
}
161+
162+
var CATS_HOTDOG = ToEmojies(cats)
163+
```
164+
165+
It doesn't even have to be from [emoji](https://github.com/enescakir/emoji),
166+
simply append a slice of your desired emojies, and use the [`ToEmojies`-func](moths/emojies/helper.go).
167+
Then provide this as an argument in `moths.WithEmojies(CATS_HOTDOG)`, when calling a new `moth`.
168+
139169
## example
140170

141171
Check out [`main.go`](main.go) for an example
@@ -147,7 +177,9 @@ Check out [`main.go`](main.go) for an example
147177

148178
## history ✍
149179

150-
- [`v2.2.0`](https://github.com/Mobilpadde/moths/tree/v2.2.0) 💘
180+
- [`v2.2.2`](https://github.com/Mobilpadde/moths/tree/v2.2.2) 💘
181+
- [`v2.2.1`](https://github.com/Mobilpadde/moths/tree/v2.2.1)
182+
- [`v2.2.0`](https://github.com/Mobilpadde/moths/tree/v2.2.0)
151183
- [`v2.1.0`](https://github.com/Mobilpadde/moths/tree/v2.1.0)
152184
- [`v2.0.0`](https://github.com/Mobilpadde/moths/tree/v2.0.0)
153185
- [`v1.0.0`](https://github.com/Mobilpadde/moths/tree/v1.0.0)

0 commit comments

Comments
 (0)