ANN: eGenix Antispam Bot for Telegram 0.6.0

2024-01-24 Thread eGenix Team via Python-list

*ANNOUNCING*


   eGenix Antispam Bot for Telegram

Version 0.6.0

A simple, yet effective bot implementation
to address Telegram signup spam.

This announcement is also available on our web-site for online reading:
https://www.egenix.com/company/news/eGenix-Antispam-Bot-for-Telegram-0.6.0-GA.html


*INTRODUCTION*

eGenix  has long been running a local Python user 
group meeting in Düsseldorf called /Python Meeting Düsseldorf 
/ and we are using a Telegram group for most of our 
communication.


In the early days, the group worked well and we only had few spammers 
joining it, which we could well handle manually.


More recently, this has changed dramatically. We are seeing between 2-5 
spam signups per day, often at night. Furthermore, the signups accounts 
are not always easy to spot as spammers, since they often come with 
profile images, descriptions, etc.


With the bot, we now have a more flexible way of dealing with the problem.

Please see our project page for details and download links:

https://www.egenix.com/library/telegram-antispam-bot/


*FEATURES*

 * Low impact mode of operation: the bot tries to keep noise in the
   group to a minimum
 * Several challenge mechanisms to choose from, more can be added as needed
 * Flexible and easy to use configuration
 * Only needs a few MB of RAM, so can easily be put into a container or
   run on a Raspberry Pi
 * Can handle quite a bit of load due to the async implementation
 * Works with Python 3.9+
 * MIT open source licensed



*NEWS*

The 0.6.0 release fixes a few bugs and adds more features:

 * Upgraded to pyrogram 2.0.106, which fixes a weird error we have been
   getting recently with the old version 1.4.16 (see
   pyrogram/pyrogram#1347
   )
 * Catch weird error from Telegram when deleting conversations; this
   seems to sometimes fail, probably due to a glitch on their side
 * Made the math and char entry challenges a little harder
 * Added new DictItemChallenge

It has been battle-tested in production for several years already 
already and is proving to be a really useful tool to help with Telegram 
group administration.



Enjoy,

--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, Jan 24 2024)

Python Projects, Coaching and Support ...https://www.egenix.com/
Python Product Development ...https://consulting.egenix.com/



::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48

D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   https://www.egenix.com/company/contact/
 https://www.malemburg.com/
--
https://mail.python.org/mailman/listinfo/python-list


Feature proposal: unittest.mock.NAN

2024-01-24 Thread Kerrick Staley via Python-list
I think we should define a unittest.mock.NAN constant that can be used with
Mock.assert_called_with() to assert that an argument passed to a Mock was
NaN. NaNs are special in that math.nan != math.nan, so you can't just do
assert_called_with(math.nan). The naming is meant to parallel
unittest.mock.ANY.

Here is a reference implementation:

class _EqNaN:
def __eq__(self, other):
return math.isnan(other)

NAN = _EqNaN()

The alternative is that users can just define this EqNaN class themselves
as needed in test code. I encountered the need to test for a NaN argument
today and was surprised to find that (as far as I can tell) there is no
pre-built solution to this in unittest or pytest. It feels like it should
be included in some standard library.

- Kerrick
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Feature proposal: unittest.mock.NAN

2024-01-24 Thread Barry Scott via Python-list
Python ideas are discussed here these days: https://discuss.python.org/
Suggest you raise this there in the Ideas category.

Barry


> On 24 Jan 2024, at 17:11, Kerrick Staley via Python-list 
>  wrote:
> 
> I think we should define a unittest.mock.NAN constant that can be used with
> Mock.assert_called_with() to assert that an argument passed to a Mock was
> NaN. NaNs are special in that math.nan != math.nan, so you can't just do
> assert_called_with(math.nan). The naming is meant to parallel
> unittest.mock.ANY.
> 
> Here is a reference implementation:
> 
> class _EqNaN:
>def __eq__(self, other):
>return math.isnan(other)
> 
> NAN = _EqNaN()
> 
> The alternative is that users can just define this EqNaN class themselves
> as needed in test code. I encountered the need to test for a NaN argument
> today and was surprised to find that (as far as I can tell) there is no
> pre-built solution to this in unittest or pytest. It feels like it should
> be included in some standard library.
> 
> - Kerrick
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list