inculi / sue Goto Github PK
View Code? Open in Web Editor NEWA bot for iMessage ([email protected]), Telegram (@ImSueBot), and Discord. Now in Elixir!
License: MIT License
A bot for iMessage ([email protected]), Telegram (@ImSueBot), and Discord. Now in Elixir!
License: MIT License
Ex: !define "Hello, how are you?" "Howdy"
I tried working on this a while back, but didn't get very far. I think the important thing is having a definite file structure. Now that I know about uuid's, it shouldn't be too big of a problem. I definitely want to have things running more async by then, though. It would probably require sending messages directly...
Anyways, I wanted to post this link here as a reminder for myself. Here's the code just incase:
set theAttachment1 to POSIX file /Users/robert/pic.png
tell application "Messages"
send theAttachment1 to buddy "+1 (xxx) x7 " of service "E:[email protected]"
end tell
I had forgotten I even made that. We now have module-level log levels, so I can breathe a sigh of relief in that regard.
I naively thought if I just ran process_message()
from within a Task that it wouldn't block the processing of other messages. This new gpt command has shown that this isn't the case. Sometimes Sue can get blocked for up to 10 seconds, which is no bueno.
Could you give it a kick? Thanks
FaceApp machine broke a while ago (still is, right? maybe I'll check again) so I figure it's time to do our own fun image stuff. This comes in three phases, methinks.
!i b&w <image>
. Then Sue sends a response. Now, if a user does not supply an image, we should be able to instead feed in the last image the user (or their friend) sent, ooorrrr... here's the chain able part: the last image Sue sent. So, after Sue has sent back a black and white image, we can then do like !i meme bottomtext
to add a text caption or something to it.!i %Identity <image>
(just got this great idea: what if we let !wolf
spit out matrices... bruh.)
!wolf
thing, we'll need to examine function chaining... Hmm maybe save this part for 3?!i [meme bottomtext]*[b&w]
. For starters, we'd probably just pass the resulting image matrix between the two functions instead of matmul, as we don't want to worry about resolving non-matrix operations (bottomtext
) before reducing.
Need to sync changes made in the nostrum repo.
Currently, !define k is allowed when we should be checking for !define k v
Ideally we have iMessage and Telegram each implementations a Mailbox protocol with only a handful of necessary functions that they need to implement to be useful with Sue (cast to Message (populated with attachments), receive message, send message). I don't like how the tg and imsg stuff is spilling over into the Message and Attachment module definitions.
too busy to push my other changes between laptop and server right now, so just putting this here as a reminder.
it could look better
+Potentially remove Signal support (or at least set it aside for deprecation)
The documentation for the AppleScript stuffs ain't pretty. The test one can also probably be removed. Maybe rename the *direct.applescript files to be more descriptive to their function.
Sigh. Get some sleep, too. The sun is beginning to rise.
Too many things to do for me to work on this right now, but I just wanted to add the idea.
Here are the responses:
responses = [
"As I see it, yes",
"It is certain",
"It is decidedly so",
"Most likely",
"Outlook good",
"Signs point to yes",
"Without a doubt",
"Yes",
"Yes - definitely",
"You may rely on it",
"Reply hazy, try again",
"Ask again later",
"Better not tell you now",
"Cannot predict now",
"Concentrate and ask again",
"Don't count on it",
"My reply is no",
"My sources say no",
"Outlook not so good",
"Very doubtful"
]
I want to create a system that allows users to create (complex? simple?) data structures that can be inputted into different functions.
What I will do is something like this... A user will use the following command to create a data structure:
!save lunch [antonios, potbelly, indian]
I will parse the textBody to determine what kind of data structure it is. I'm probably going to keep it to strings and lists for the time being.
Anyways, when sue detects that she is being asked to execute a command, she will scan the inputted textBody for words that begin with #. She will then query her database for the existence of these words, and replace their <#word> occurrences with <value>.
As an example, !choose #lunch
would be interpreted as !choose antonios, potbelly, indian
according to the !save
statement we used earlier. Note: this brings up another discussion as to whether we should be using commas to specify lists (as for !choose) or newlines (as for !poll). Maybe someone out there has come up with a good solution for this.
Another idea that comes up when discussing this is possibly adding user-defined functions (they'd have to be elementary for now, though). Function declarations would have precendence over definitions, though we would need to delete its counterpart (to overwrite) each time it is redefined/redeclared.
I'm thinking something like this:
!save lunchPlaces [antonios, potbelly, indian]
!lambda lunch !choose #lunchPlaces
It could get pretty complex fairly quickly though. Definitely lots of planning needed.
/poll a b
does not work. I'm guessing it's a problem with ExGram.send_poll or whatever I use
"your bot will not be able to send more than 20 messages per minute to the same group."
Not a fan of Mongo's new license. Might be worth moving to Postgres, considering we're already entertaining the idea of Elixir. Look into it.
I've been adding these is_premium
and is_admin
fields to the Account struct. I foresee eventually adding other perms like Plex access, maybe Home Assistant, etc. Maybe that should be a tag sort of thing instead.
We process Telegram messages a little over 2x slower than iMessages. It's to be expected when we respond via POST request instead of [Apple|osa]script, but look into improvements anyway.
It'd be nice if we could use the stream api for GPT for at least Telegram and Discord responses. Doing this would probably require some sort of queue such that we don't go over Discord or Telegram's API limits.
Might be worth just starting with Discord for now, as I may end up replacing all the Telegram stuff later anyway.
Some new message case I haven't seen before. Check the info logs later I guess.
Last message: :get_updates
04:51:40.684 [error] GenServer Sue.Mailbox.IMessage terminating
** (FunctionClauseError) no function clause matching in Sue.Models.Message.better_trim_leading/1
(sue 0.2.3) lib/sue/models/message.ex:323: Sue.Models.Message.better_trim_leading(nil)
(sue 0.2.3) lib/sue/models/message.ex:350: Sue.Models.Message.has_command?/2
(sue 0.2.3) lib/sue/models/message.ex:301: Sue.Models.Message.command_args_from_body/2
(sue 0.2.3) lib/sue/models/message.ex:93: Sue.Models.Message.from_imessage/1
(elixir 1.14.3) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
(sue 0.2.3) lib/sue/mailbox/i_message.ex:116: Sue.Mailbox.IMessage.process_messages/1
(sue 0.2.3) lib/sue/mailbox/i_message.ex:27: Sue.Mailbox.IMessage.handle_info/2
(stdlib 4.2) gen_server.erl:1123: :gen_server.try_dispatch/4
Last message: :get_updates
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.