Question: The Situation
-------------

I am currently creating a Telegram bot for me and some friends that stores all chat messages we send in our group chat in a database so that we can retrieve advanced chat statistics. I live in Germany.

---

Arising Questions
-----------------

Now my first question is **if it would be legal to save group chat messages from my friend group, regarding that**:

* everybody orally agreed to me storing all the messages on my private server
* I have access to all the messages anyway since they are stored on the Telegram servers and I can read them from my account whenever I want, so I'm at least not reading any messages that are not for my ears

Because Telegram Bots are publicly available and can be used by anybody, another question arises: 
**If another person I don't know uses the Bot to get chat statistics, could I get in legal trouble for storing their messages even though I explicitly stated that said data collection is necessary and ask for their consent?**

* If so, could I take measures to prevent this while still letting anybody who wants use the bot? Or would I be better off just hard-coding that only messages from me and my friend-group can be stored?
* I don't want to collect tons of private messages from random strangers and wouldn't advertise the bot or anything. This is more about the theoretical possibility that anybody who wants to, could hypothetically message the bot even though it is not meant for them or invite it in their group chat and their messages would of course be stored as well.

My vision for the Bot would be (since I believe that chat statistics might still be an interesting feature for many group chats) to offer the source code on GitHub along with some setup instructions so that anybody can set up their own personal instance of the statistics bot on their own private server with their own database. **Could I then still get in legal trouble for providing the source code that others could possibly use to store large amounts of private chat data from third parties (or would that be entirely their fault)?**

Answer: 
A promise that a court would not enforce by injunction can still be valid consideration and be part of a valid contract. Failure to carry out such obligations would lead to some measure of money damages, most likely. 

On the other hand, provisions specifically barred by law, or against public policy, such as a promise to commit a crime, are void from the start, and form no part of a valid contract. Such provisions may be treated by a court as if they had just been left out, or if they were essential to the contract, or formed the sole consideration, the whole contract might be considered void.

If a term is too vague for a court to determine if it has been violated or not, the court may try to clarify it, or may just ignore it. Just what it would mean for a tenant to "undermine the leadership" of a landlord is not clear to me, at least. That might well be held to be "too vague". As to "not complain" it may be that a tenant has a legal right to make official complaints, which cannot be waived by contract. Or it may not, depending on the local laws.
> 
> If I agreed to these terms what would happen?
> 
> 
> 

They have no effect on the rest of the contract. The "anti-undermine" and "anti-complain" clauses are unenforceable as too vague and oppressive (somewhat related to the notion of duress), respectively.

More important is to bear in mind that the *actual* consideration in your matter is the renting or ceding of *your* entitlement to the use of that storage space. You paid for a space that you gave up under the landlord's promise of a share of income he would earn from third-parties who rent it.

Furthermore, failure to reimburse you the portion pertaining to the storage space is tantamount to double renting the same space. Statutory law typically prohibits double renting, and your landlord's situation might bring him within scope of those landlord-tenant statutes.

> 
> can I present this as evidence of some kind?
> 
> 
> 

That is unclear for someone who is neither familiar with Canadian procedural law nor with the evidence you have in this regard (for instance, you mention that the agreement is not in writing).