Merge pull request 'Small corrections' (#1) from zneix/examples:zneix/code-simplification into master

Reviewed-on: #1
This commit is contained in:
Mm2PL 2022-04-26 13:57:36 +02:00
commit 71f3e55ded
4 changed files with 7 additions and 4 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# binaries
cmd/examples2json/examples2json
cmd/gen_examples/gen_examples

View File

@ -19,7 +19,7 @@ func main() {
}
var allExamples []examples.Example
for _, file := range strings.Split(*files, ",") {
file = strings.Trim(file, " ")
file = strings.TrimSpace(file)
f, err := os.Open(file)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to open %s for reading: %s\n", file, err)

View File

@ -92,7 +92,7 @@ func ExamplesIrcPrivmsg() []string {
}
}
// PubsubChatModeratorActionsUserBanned returns a message notifying of user `1xcelerate` (ID: `140114344`) getting permabanned from `#mm2pl` by `mm2pl` (ID: `117691339`) (2021-11-20)
// PubsubChatModeratorActionsUserBanned returns a message notifying of user `1xelerate` (ID: `140114344`) getting permabanned from `#mm2pl` by `mm2pl` (ID: `117691339`) (2021-11-20)
func PubsubChatModeratorActionsUserBanned() string {
return "{\"type\":\"MESSAGE\",\"data\":{\"topic\":\"chat_moderator_actions.117691339.117691339\",\"message\":\"{\\\"type\\\":\\\"moderation_action\\\",\\\"data\\\":{\\\"type\\\":\\\"chat_login_moderation\\\",\\\"moderation_action\\\":\\\"ban\\\",\\\"args\\\":[\\\"1xelerate\\\",\\\"\\\"],\\\"created_by\\\":\\\"mm2pl\\\",\\\"created_by_user_id\\\":\\\"117691339\\\",\\\"created_at\\\":\\\"2021-11-20T00:12:23.282996104Z\\\",\\\"msg_id\\\":\\\"\\\",\\\"target_user_id\\\":\\\"140114344\\\",\\\"target_user_login\\\":\\\"\\\",\\\"from_automod\\\":false}}\"}}"
}

View File

@ -2,7 +2,7 @@
## Chat moderator actions
- `UserBanned`: a message notifying of user `1xcelerate` (ID: `140114344`) getting permabanned from `#mm2pl` by `mm2pl` (ID: `117691339`) (2021-11-20)
- `UserBanned`: a message notifying of user `1xelerate` (ID: `140114344`) getting permabanned from `#mm2pl` by `mm2pl` (ID: `117691339`) (2021-11-20)
```json
{"type":"MESSAGE","data":{"topic":"chat_moderator_actions.117691339.117691339","message":"{\"type\":\"moderation_action\",\"data\":{\"type\":\"chat_login_moderation\",\"moderation_action\":\"ban\",\"args\":[\"1xelerate\",\"\"],\"created_by\":\"mm2pl\",\"created_by_user_id\":\"117691339\",\"created_at\":\"2021-11-20T00:12:23.282996104Z\",\"msg_id\":\"\",\"target_user_id\":\"140114344\",\"target_user_login\":\"\",\"from_automod\":false}}"}}
```
@ -37,4 +37,4 @@ TODO:
- `ReceivedWithEmotes`: a whisper received from `Mm_sUtilityBot` with an emote inside
```json
{"type":"MESSAGE","data":{"topic":"whispers.117691339","message":"{\"type\":\"whisper_received\",\"data\":\"{\\\"message_id\\\":\\\"955d4707-79dc-4ab0-887e-404002e96e5c\\\",\\\"id\\\":8308,\\\"thread_id\\\":\\\"117691339_442600612\\\",\\\"body\\\":\\\"Kappa Keepo 123 asd\\\",\\\"sent_ts\\\":1650141273,\\\"from_id\\\":442600612,\\\"tags\\\":{\\\"login\\\":\\\"mm_sutilitybot\\\",\\\"display_name\\\":\\\"Mm_sUtilityBot\\\",\\\"color\\\":\\\"#008000\\\",\\\"emotes\\\":[{\\\"emote_id\\\":\\\"25\\\",\\\"start\\\":0,\\\"end\\\":4},{\\\"emote_id\\\":\\\"1902\\\",\\\"start\\\":6,\\\"end\\\":10}],\\\"badges\\\":[{\\\"id\\\":\\\"glitchcon2020\\\",\\\"version\\\":\\\"1\\\"}]},\\\"recipient\\\":{\\\"id\\\":117691339,\\\"username\\\":\\\"mm2pl\\\",\\\"display_name\\\":\\\"Mm2PL\\\",\\\"color\\\":\\\"#DAA520\\\"}}\",\"data_object\":{\"message_id\":\"955d4707-79dc-4ab0-887e-404002e96e5c\",\"id\":8308,\"thread_id\":\"117691339_442600612\",\"body\":\"Kappa Keepo 123 asd\",\"sent_ts\":1650141273,\"from_id\":442600612,\"tags\":{\"login\":\"mm_sutilitybot\",\"display_name\":\"Mm_sUtilityBot\",\"color\":\"#008000\",\"emotes\":[{\"emote_id\":\"25\",\"start\":0,\"end\":4},{\"emote_id\":\"1902\",\"start\":6,\"end\":10}],\"badges\":[{\"id\":\"glitchcon2020\",\"version\":\"1\"}]},\"recipient\":{\"id\":117691339,\"username\":\"mm2pl\",\"display_name\":\"Mm2PL\",\"color\":\"#DAA520\"}}}"}}
```
```