You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
added rss functionality to milla, watchlists now allow you to give them a color so they can actually show you what they matched, bunch of other changes
sql = "select log from liberanet_milla_us_market_news order by log desc;"
348
400
limit = 300
349
401
context = ["you are a sentiment-analysis bot"]
350
402
prompt= "i have provided to you news headlines in the form of previous conversations between you and me using the user role. please provide the digest of the news for me."
351
-
[ircd.devinet_terra.customCommands.summarize]
403
+
[ircd.liberanet.customCommands.summarize]
352
404
sql= "select log from liberanet_milla_us_market_news order by log desc;"
353
405
limit= 300
354
406
context = ["you are a sentiment-analysis bot"]
@@ -393,6 +445,14 @@ Load a plugin: `/load /plugins/rss.lua`
393
445
394
446
Unload a plugin: `/unload /plugins/rss.lua`
395
447
448
+
#### remind
449
+
450
+
Pings the user after the given amount in seconds: `/remind 1200`
451
+
452
+
#### roll
453
+
454
+
Rolls a number between 1 and 6 if no arguments are given. With one argument it rolls a number between 1 and the given number. With two arguments it rolls a number between the two numbers: `/rool 10000 66666`
- Each lua plugin gets its own lua state and will run in a goroutine.<br/>
770
830
- Lua plugins will not go through a proxy if they are not instructed to do so. If you are using the provided http module, you can set the proxy value before loading the http module as provided in the examples under `plugins`. The module will read and set the following environment variables in the order given:
Copy file name to clipboardexpand all lines: main.go
+74
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ import (
10
10
"fmt"
11
11
"index/suffixarray"
12
12
"log"
13
+
"math/rand"
13
14
"net"
14
15
"net/http"
15
16
"net/url"
@@ -222,6 +223,8 @@ func getHelpString() string {
222
223
helpString+="memstats - returns the memory status currently being used\n"
223
224
helpString+="load - loads a lua script\n"
224
225
helpString+="unload - unloads a lua script\n"
226
+
helpString+="remind - reminds you in a given amount of seconds\n"
227
+
helpString+="roll - rolls a dice. the number is between 1 and 6. One arg sets the upper limit. Two args sets the lower and upper limit in that order\n"
225
228
226
229
returnhelpString
227
230
}
@@ -546,6 +549,71 @@ func runCommand(
546
549
}
547
550
548
551
appConfig.deleteLstate(args[1])
552
+
case"remind":
553
+
iflen(args) <2 {
554
+
client.Cmd.Reply(event, errNotEnoughArgs.Error())
555
+
556
+
break
557
+
}
558
+
559
+
seconds, err:=strconv.Atoi(args[1])
560
+
iferr!=nil {
561
+
client.Cmd.Reply(event, errNotEnoughArgs.Error())
562
+
563
+
break
564
+
}
565
+
566
+
client.Cmd.Reply(event, "Ok, I'll remind you in "+args[1]+" seconds.")
567
+
time.Sleep(time.Duration(seconds) *time.Second)
568
+
569
+
client.Cmd.ReplyTo(event, " Ping!")
570
+
case"forget":
571
+
572
+
client.Cmd.Reply(event, "I no longer even know whether you're supposed to wear or drink a camel.'")
573
+
case"roll":
574
+
lowerLimit:=1
575
+
upperLimit:=6
576
+
577
+
iflen(args) ==1 {
578
+
} elseiflen(args) ==2 {
579
+
argOne, err:=strconv.Atoi(args[1])
580
+
581
+
iferr!=nil {
582
+
client.Cmd.Reply(event, errNotEnoughArgs.Error())
583
+
584
+
break
585
+
}
586
+
587
+
upperLimit=argOne
588
+
} elseiflen(args) ==3 {
589
+
argOne, err:=strconv.Atoi(args[1])
590
+
591
+
iferr!=nil {
592
+
client.Cmd.Reply(event, errNotEnoughArgs.Error())
593
+
594
+
break
595
+
}
596
+
597
+
lowerLimit=argOne
598
+
599
+
argTwo, err:=strconv.Atoi(args[2])
600
+
601
+
iferr!=nil {
602
+
client.Cmd.Reply(event, errNotEnoughArgs.Error())
603
+
604
+
break
605
+
}
606
+
607
+
upperLimit=argTwo
608
+
} else {
609
+
client.Cmd.Reply(event, errors.New("too many args").Error())
0 commit comments