Comments (6)
Hey @kaptinlin, thanks for sharing your idea/problem.
Have you considered using separate notify
instances? For example like this:
// Notifier for receiver 1
service1, _ := telegram.New("")
service1.AddReceivers(-1234567890)
n1 := notify.NewWithServices(service1)
_ = n1.Send(context.Background(), "Hello", "The message to fooReceiver")
// Notifier for receiver 2
service2, _ := telegram.New("")
service2.AddReceivers(-9876543210)
n2 := notify.NewWithServices(service2)
_ = n2.Send(context.Background(), "Hello", "The message to barReceiver")
I can see that your solution would add more flexibility but I want to consider other solutions first before agreeing or declining your idea. Would my example solve your problem?
from notify.
@nikoksr yes, it can works.
I was look for a way not initialize the service when send to different receivers.
from notify.
hi @nikoksr @kaptinlin has this feature been implemented? I think I want to start contributing by solving this issue, would you mind?
from notify.
nope, if you can contribute that would be awesome
from notify.
@rafimuhammad01 welcome to the project. I appreciate your willingness to support the project! We'd all be excited for your contributions in any way, shape or form.
@kaptinlin could you please clarify why this feature would be beneficial for the project? This seems like a subtle pattern change and I don't want to accept changes that unnecessarily change Notify's usage patterns. Actually, this is a major pattern change due to the introduction of the Receiver
type, which we'd need to individually implement for every service respectively.
Also, I'm not happy with the linguistic choice here. Keeping in mind that chained methods should sound as close as possible to an actual english sentence, the signature is not logically sound. Notify to <receiver> send <message>
is not exactly gramatically correct. Something like Notify send <message> to <receiver>
would be cleaner. Obviously this does not work, since the Send()
method returns an error type and thus does not allow for further method chaining.
To summarize, I'd more than happily accept your guys' idea and contribution but we need a clear explanation of what problem this exactly solves, plus, the signature has to change. I'm not okay with notify.To(...).Send(...)
.
cc @svaloumas
from notify.
Closing until further notice.
from notify.
Related Issues (20)
- feat(service): Add Google Chat service HOT 6
- feat(service): Add Home-Assistant service HOT 3
- feat(service): Add Ntfy service HOT 1
- feat(service): Add Reddit service HOT 3
- feat(service): Add Streamlabs service HOT 5
- feat(service): Add WeCom service HOT 1
- Who uses Notify? HOT 2
- feat(service): Add [Microsoft Teams] service HOT 1
- feat(service): Add IOS web push service HOT 1
- Discord Webhooks HOT 4
- Expanding testing suite HOT 1
- feat(service): Add [iMessage] service HOT 1
- feat(service): Add kakaotalk service
- feat(service): proxy setting
- feat(service): Add WeCom service
- [HELP] How to make senderAddress Dynamic HOT 1
- can't install use go get
- feat(service): Add [OneBot11] service HOT 1
- Reference to a non-existent version number of go-reddit
- O365 connectors within Teams will be deprecated HOT 1
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 notify.