Comments (11)
see PR #99
from bot.
You could make a plugin that would set up webhook receiver which would populate internal queue and periodic command that would check internal queue and possibly post message?
from bot.
@sochotnicky I think that the way to go is to create a new kind of command that would return a struct with a message chan and a done chan, then you would write on this chan upon receiving a message on the webhook, something like the CmdV3 works, but with 2 chans instead of just one for done: https://github.com/go-chat-bot/bot/blob/master/cmd.go#L96
This way the bot could start a goroutine that would pool this chan waiting for new messages from the webhook.
Something like:
type WebhookCmdResult struct {
Data chan struct {
Message string
Channel string
}
Done chan bool
}
from bot.
Yeah that approach would certainly be cleaner overall. My proposal was more about a way to do it without changing the bot, but direct bot support for this approach would be nicer. I wouldn't call it "WebhookCmdResult" - maybe something like MessageStreamCmdResult with the register method called RegisterMessageStreamCommand? Or something of the sort that's not directly tied to "webhook" since I assume it could be used in different contexts?
from bot.
Thanks for considering the issue and the technicalities.
If I want to notify irc://freenode.net/#go-bots but not any of the other platforms including irc://ourprivate.com/#inhouse? Is there a spot where the adapter/bot exposes a struct which includes network name?
Or how about reacting to irc://freenode.net by notifying a channel on irc://our private.com/#inhouse
Somewhat of an aside but related, my next itch to scratch is persistent storage which rubs up against a number of these same issues.
from bot.
@sochotnicky @fabioxgn would love to get your feedback on #101 - thanks much!
from bot.
Hi @bnfinet I think I'll have some time this weekend to take a look at it, thanks for the contribution.
from bot.
@sochotnicky @fabioxgn Happy New Year!
Do you have any time that you could spare to reviewing my PR? I have a few other features which I'd be happy to submit PRs for but it doesn't make sense to me to submit those until #101 is cleared.
Thanks much!
from bot.
@bnfinet sorry for the delay, I was hoping to test your changes locally for a more detailed review, but I don't think I'll have the spare time for that soon. For now I've reviewed your PR and just pointed out some documentation and forgotten comments issues, can you please fix those? Then I'll merge your PR. Thanks.
from bot.
Thanks much @fabioxgn for the review and feedback. I've incorporated those changes you've suggested with the exception of the defer nsMap.Unlock()
which when implemented causes the tests to fail. Not quite sure why that's the case but I'm going to hold off on that for now.
Do let me know if there's anything else.
from bot.
@bnfinet thanks, I've merged you PR.
from bot.
Related Issues (20)
- clean or escape single and double quotes and parentheses from command arguments
- Make using Unidecode optional
- Send a message to a specific adapter HOT 1
- Support Reaction Handling
- build: error finding git.apache.org/thrift.git HOT 4
- Errors are shown publicly
- How run this bot HOT 2
- Support text formatting for Slack HOT 1
- Rocket.Chat default port for a bot?
- Idk first time
- Tt
- Cus
- integration of RegisterMessageReceiveFilter work HOT 1
- async def on_message(message): if message.author == client.user: return msg = message.content if msg.startswith('$inspire'): quote = get_quote() await message.channel.send(quote) if any(word in msg for word in sad_words): await message.channel.send(random.choice(starter_encouragements))
- Update request to use SocketMode and WSS as RTM is deprecated in Slack API.
- Coucou
- expose command prefix in `irc.Config` HOT 1
- Teste
- Wirbeltier
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bot.