Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mayurmarvel/aos-unbox
An Unofficial Inbox (UNBOX) for AOS Messages
https://github.com/mayurmarvel/aos-unbox
ao-compute aos arweave arweave-permaweb
Last synced: about 1 month ago
JSON representation
An Unofficial Inbox (UNBOX) for AOS Messages
- Host: GitHub
- URL: https://github.com/mayurmarvel/aos-unbox
- Owner: mayurmarvel
- Created: 2024-03-09T01:47:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-10T12:37:43.000Z (10 months ago)
- Last Synced: 2024-03-11T03:37:50.644Z (10 months ago)
- Topics: ao-compute, aos, arweave, arweave-permaweb
- Language: JavaScript
- Homepage: https://aos-unbox.vercel.app
- Size: 250 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AOS Unbox
An Unofficial AOS Inbox## Configuring Unbox
- Copy this lua code
```lua
Handlers.add('inboxCount', Handlers.utils.hasMatchingTag('Action', '#Inbox'), function(msg)
-- Assuming Inbox is an array containing the messages
local inboxCount = #Inbox
-- Send the inbox count as a response
ao.send({
Target = msg.From,
Tags = { InboxCount = tostring(inboxCount) }
})
end)
Handlers.add('inboxMessage', Handlers.utils.hasMatchingTag('Action', 'CheckInbox'), function(msg)
-- Extract the index from the tags
local index = tonumber(msg.Tags.Index)
-- Check if the index is valid and within the range of the inbox messages
if index and index > 0 and index <= #Inbox then
-- Retrieve the message details based on the index
local message = Inbox[index]
-- Send the message details as a response
ao.send({
Target = msg.From,
Tags = {
Action = "Inbox",
Index = tostring(index),
MessageDetails = message
}
})
else
-- If the index is invalid or out of range, send an error message
ao.send({
Target = msg.From,
Tags = { Error = "Invalid inbox message index" }
})
end
end)
```- save it as `inbox.lua`
- start the aos process & load the file
.load inbox.lua
- get your process id
ao.id
- visit the [aos-unbox](https://aos-unbox.vercel.app/) site and enter your pocess id to login
## Credits
- Notification Sounds : [Click here](https://notificationsounds.com/)
- Bgjar SVG : [Click here](https://bgjar.com/)
- @uiwjs/react-json-view : [Click here](https://github.com/uiwjs/react-json-view)
- Dice Bear Avatars : [click here](https://www.dicebear.com/styles/bottts-neutral/)
- shadcn/ui : [Click here](https://ui.shadcn.com/)