Giter Site home page Giter Site logo

karatekhd / nemesis Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 4.0 726 KB

OpenGM - Open Source Telegram Group Management Bot written in Python

Home Page: https://opengm.karatek.net

License: GNU General Public License v3.0

Python 99.36% Shell 0.64% Procfile 0.01%
bot telegram-bot python-telegram-bot antispambot groupmanagement python telegram

nemesis's Introduction

OpenGM (Open Group Manager)

Codacy Badge Crowdin

A modular telegram Python bot running on python3 with an sqlalchemy database. This is a fork of PaulSonOfLars tgbot.

Originally a simple group management bot with multiple admin features, it has evolved into becoming a basis for modular bots aiming to provide simple plugin expansion via a simple drag and drop.

Can be found on telegram as Nemesis.

Installing the bot

To install the bot on openSUSE, follow the steps on https://software.opensuse.org/download/package?package=opengm&project=home%3AKaratekHD

Starting the bot.

Once you've setup your database and your configuration (see below) is complete, simply run:

systemctl start opengm

Setting up the bot (Read this before trying to use!):

Please make sure to use python3.6, as I cannot guarantee everything will work as expected on older python versions! This is because markdown parsing is done by iterating through a dict, which are ordered by default in 3.6.

Configuration

There are two possible ways of configuring your bot: a config.py file, or ENV variables.

The prefered version is to use a config.py file, as it makes it easier to see all your settings grouped together. This file should be placed in your tg_bot folder, alongside the __main__.py file . This is where your bot token will be loaded from, as well as your database URI (if you're using a database), and most of your other settings.

It is recommended to import sample_config and extend the Config class, as this will ensure your config contains all defaults set in the sample_config, hence making it easier to upgrade.

An example config.py file could be:

from tg_bot.sample_config import Config


class Development(Config):
    OWNER_ID = 254318997  # my telegram ID
    OWNER_USERNAME = "SonOfLars"  # my telegram username
    API_KEY = "your bot api key"  # my api key, as provided by the botfather
    SQLALCHEMY_DATABASE_URI = 'postgresql://username:password@localhost:5432/database'  # sample db credentials
    MESSAGE_DUMP = '-1234567890' # some group chat that your bot is a member of
    USE_MESSAGE_DUMP = True
    SUDO_USERS = [18673980, 83489514]  # List of id's for users which have sudo access to the bot.
    LOAD = []
    NO_LOAD = ['translation']

If you can't have a config.py file (EG on heroku), it is also possible to use environment variables. The following env variables are supported:

  • ENV: Setting this to ANYTHING will enable env variables

  • TOKEN: Your bot token, as a string.

  • OWNER_ID: An integer of consisting of your owner ID

  • OWNER_USERNAME: Your username

  • DATABASE_URL: Your database URL

  • MESSAGE_DUMP: optional: a chat where your replied saved messages are stored, to stop people deleting their old

  • LOAD: Space separated list of modules you would like to load

  • NO_LOAD: Space separated list of modules you would like NOT to load

  • WEBHOOK: Setting this to ANYTHING will enable webhooks when in env mode messages

  • URL: The URL your webhook should connect to (only needed for webhook mode)

  • SUDO_USERS: A space separated list of user_ids which should be considered sudo users

  • SUPPORT_USERS: A space separated list of user_ids which should be considered support users (can gban/ungban, nothing else)

  • WHITELIST_USERS: A space separated list of user_ids which should be considered whitelisted - they can't be banned.

  • DONATION_LINK: Optional: link where you would like to receive donations.

  • CERT_PATH: Path to your webhook certificate

  • PORT: Port to use for your webhooks

  • DEL_CMDS: Whether to delete commands from users which don't have rights to use that command

  • STRICT_GBAN: Enforce gbans across new groups as well as old groups. When a gbanned user talks, he will be banned.

  • WORKERS: Number of threads to use. 8 is the recommended (and default) amount, but your experience may vary. Note that going crazy with more threads wont necessarily speed up your bot, given the large amount of sql data accesses, and the way python asynchronous calls work.

  • BAN_STICKER: Which sticker to use when banning people.

  • ALLOW_EXCL: Whether to allow using exclamation marks ! for commands as well as /.

Python dependencies

Install the necessary python dependencies by moving to the project directory and running:

pip3 install -r requirements.txt.

This will install all necessary python packages.

Database

If you wish to use a database-dependent module (eg: locks, notes, userinfo, users, filters, welcomes), you'll need to have a database installed on your system. Nemesis uses postgres, other databases are not supported. This is how you would set up a the database on a debian/ubuntu system. Other distributions may vary.

  • install postgresql:

sudo apt-get update && sudo apt-get install postgresql

  • change to the postgres user:

sudo su - postgres

  • create a new database user (change YOUR_USER appropriately):

createuser -P -s -e YOUR_USER

This will be followed by you needing to input your password.

  • create a new database table:

createdb -O YOUR_USER YOUR_DB_NAME

Change YOUR_USER and YOUR_DB_NAME appropriately.

  • finally:

psql YOUR_DB_NAME -h YOUR_HOST YOUR_USER

This will allow you to connect to your database via your terminal. By default, YOUR_HOST should be 0.0.0.0:5432.

You should now be able to build your database URI. This will be:

sqldbtype://username:pw@hostname:port/db_name

Replace sqldbtype with whichever db youre using (eg postgres, mysql, sqllite, etc) repeat for your username, password, hostname (localhost?), port (5432?), and db name.

Modules

Setting load order.

The module load order can be changed via the LOAD and NO_LOAD configuration settings. These should both represent lists.

If LOAD is an empty list, all modules in modules/ will be selected for loading by default.

If NO_LOAD is not present, or is an empty list, all modules selected for loading will be loaded.

If a module is in both LOAD and NO_LOAD, the module will not be loaded - NO_LOAD takes priority.

Creating your own modules.

Creating a module has been simplified as much as possible - but do not hesitate to suggest further simplification.

All that is needed is that your .py file be in the modules folder.

To add commands, make sure to import the dispatcher via

from tg_bot import dispatcher.

You can then add commands using the usual

dispatcher.add_handler().

Assigning the __help__ variable to a string describing this modules' available commands will allow the bot to load it and add the documentation for your module to the /help command. Setting the __mod_name__ variable will also allow you to use a nicer, user friendly name for a module.

The __migrate__() function is used for migrating chats - when a chat is upgraded to a supergroup, the ID changes, so it is necessary to migrate it in the db.

The __stats__() function is for retrieving module statistics, eg number of users, number of chats. This is accessed through the /stats command, which is only available to the bot owner.

nemesis's People

Contributors

codacy-badger avatar deepsource-autofix[bot] avatar deepsourcebot avatar karatekhd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nemesis's Issues

Migrate to python-telegram 12

We need to migrate to the newer api version. See this for more details.

If we start the bot with the new API installed, we get the following:

[2020-09-02 13:13:47,915 | INFO] Owner: 540549815
[2020-09-02 13:13:47,919 | INFO] Co-Owner: 1056208268
/home/nemesisbot/Nemesis/tg_bot/__init__.py:147: TelegramDeprecationWarning: Old Handler API is deprecated - see https://git.io/fxJuV for details
  updater = tg.Updater(TOKEN, workers=WORKERS)
[2020-09-02 13:13:47,932 | INFO] Not loading: ['translation', 'sed']
[2020-09-02 13:13:47,933 | INFO] Modules to load: ['admin', 'afk', 'antiflood', 'backups', 'bans', 'blacklist', 'cust_filters', 'disable', 'global_bans', 'lang', 'locks', 'log_channel', 'misc', 'msg_deleting', 'muting', 'notes', 'reporting', 'rss', 'rules', 'userinfo', 'users', 'warns', 'welcome']
/home/nemesisbot/Nemesis/tg_bot/modules/helper_funcs/handlers.py:55: TelegramDeprecationWarning: RegexHandler is deprecated. See https://git.io/fxJuV for more info
  super().__init__(pattern, callback, **kwargs)
/usr/lib/python3.6/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: message_updates is deprecated. See https://git.io/fxJuV for more info
  edited_updates=edited_updates)
/usr/lib/python3.6/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: channel_post_updates is deprecated. See https://git.io/fxJuV for more info
  edited_updates=edited_updates)
/usr/lib/python3.6/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: edited_updates is deprecated. See https://git.io/fxJuV for more info
  edited_updates=edited_updates)
/home/nemesisbot/Nemesis/tg_bot/modules/blacklist.py:175: TelegramDeprecationWarning: edited_updates is deprecated. See https://git.io/fxJuV for more info
  (Filters.text | Filters.command | Filters.sticker | Filters.photo) & Filters.group, del_blacklist, edited_updates=True)
/home/nemesisbot/Nemesis/tg_bot/modules/helper_funcs/handlers.py:55: TelegramDeprecationWarning: RegexHandler is deprecated. See https://git.io/fxJuV for more info
  super().__init__(pattern, callback, **kwargs)
/usr/lib/python3.6/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: message_updates is deprecated. See https://git.io/fxJuV for more info
  edited_updates=edited_updates)
/usr/lib/python3.6/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: channel_post_updates is deprecated. See https://git.io/fxJuV for more info
  edited_updates=edited_updates)
/usr/lib/python3.6/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: edited_updates is deprecated. See https://git.io/fxJuV for more info
  edited_updates=edited_updates)
[2020-09-02 13:13:52,155 | INFO] Successfully loaded modules: ['admin', 'afk', 'antiflood', 'backups', 'bans', 'blacklist', 'cust_filters', 'disable', 'global_bans', 'lang', 'locks', 'log_channel', 'misc', 'msg_deleting', 'muting', 'notes', 'reporting', 'rss', 'rules', 'userinfo', 'users', 'warns', 'welcome']
[2020-09-02 13:13:52,158 | INFO] Using long polling.
[2020-09-02 13:14:04,871 | ERROR] An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/nemesisbot/Nemesis/tg_bot/__main__.py", line 493, in process_update
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/home/nemesisbot/Nemesis/tg_bot/__main__.py", line 493, in <genexpr>
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/home/nemesisbot/Nemesis/tg_bot/modules/helper_funcs/handlers.py", line 45, in check_update
    res = self.filters(message)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 88, in __call__
    return self.filter(update)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 186, in filter
    base_output = self.base_filter(update)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 88, in __call__
    return self.filter(update)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 1349, in filter
    return update.message is not None or update.edited_message is not None
AttributeError: 'Message' object has no attribute 'message'
[2020-09-02 13:14:04,880 | ERROR] An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/nemesisbot/Nemesis/tg_bot/__main__.py", line 493, in process_update
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/home/nemesisbot/Nemesis/tg_bot/__main__.py", line 493, in <genexpr>
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/home/nemesisbot/Nemesis/tg_bot/modules/locks.py", line 74, in check_update
    return super().check_update(update) and not (
  File "/home/nemesisbot/Nemesis/tg_bot/modules/helper_funcs/handlers.py", line 45, in check_update
    res = self.filters(message)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 88, in __call__
    return self.filter(update)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 186, in filter
    base_output = self.base_filter(update)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 88, in __call__
    return self.filter(update)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 1349, in filter
    return update.message is not None or update.edited_message is not None
AttributeError: 'Message' object has no attribute 'message'
[2020-09-02 13:14:04,884 | ERROR] An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/nemesisbot/Nemesis/tg_bot/__main__.py", line 493, in process_update
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/home/nemesisbot/Nemesis/tg_bot/__main__.py", line 493, in <genexpr>
    for handler in (x for x in self.handlers[group] if x.check_update(update)):
  File "/home/nemesisbot/Nemesis/tg_bot/modules/disable.py", line 58, in check_update
    if super().check_update(update):
  File "/home/nemesisbot/Nemesis/tg_bot/modules/helper_funcs/handlers.py", line 45, in check_update
    res = self.filters(message)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 88, in __call__
    return self.filter(update)
  File "/usr/lib/python3.6/site-packages/telegram/ext/filters.py", line 1349, in filter
    return update.message is not None or update.edited_message is not None
AttributeError: 'Message' object has no attribute 'message'
[2020-09-02 13:14:04,888 | ERROR] An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/nemesisbot/Nemesis/tg_bot/__main__.py", line 494, in process_update
    handler.handle_update(update, self)
TypeError: handle_update() missing 1 required positional argument: 'check_result'

RSS verification fails for planet.opensuse.org

Describe the bug
The RSS module does not parse the feed on https://planet.opensuse.org/global/rss20.xml. It fails with This link is not an RSS Feed link

To Reproduce
Steps to reproduce the behavior:

  1. Open a private chat with the bot
  2. Run /rss https://planet.opensuse.org/global/rss20.xml
  3. See error

Expected behavior
The bot shows basic information about the feed file.

Screenshots
Screenshot_20220106-235954_Nekogram_X~2.png

Version information (please complete the following information):

  • Telegram Version: v8.4.2
  • Nemesis Version: v2.2.0

Additional context
This problem occurs because the feed file in planet-o.o does not have the correct HTTP Header set (see openSUSE/planet-o-o#21 ). A potential fix for this would be to handle the feedparser.NonXMLContentType exception, as described in https://feedparser.readthedocs.io/en/latest/character-encoding.html#advanced-encoding.

Can not use the bot in channels

Describe the bug
The bot just does not react to messages sent in channels.

To Reproduce
Steps to reproduce the behavior:

  1. Add the bot to a channel
  2. Run /runs

Expected behavior
The bot replies

/kang does not work with animated stickers

Describe the bug
When executing /kang on an animated sticker, the bot will "type" for a short moment, and then nothing happens. It produces the following error in console:

Dec 04 15:21:50 feuerstern startBot.sh[4693]: [2020-12-04 15:21:50,535 | ERROR] No error handlers are registered, logging exception.
Dec 04 15:21:50 feuerstern startBot.sh[4693]: Traceback (most recent call last):
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/home/nemesisbot/Nemesis/tg_bot/modules/stickers.py", line 199, in kang
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     emojis=sticker_emoji,
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "<decorator-gen-61>", line 2, in add_sticker_to_set
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/usr/lib/python3.6/site-packages/telegram/bot.py", line 135, in decorator
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     result = func(*args, **kwargs)
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/usr/lib/python3.6/site-packages/telegram/bot.py", line 4124, in add_sticker_to_set
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     result = self._post('addStickerToSet', data, timeout=timeout, api_kwargs=api_kwargs)
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/usr/lib/python3.6/site-packages/telegram/bot.py", line 245, in _post
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     return self.request.post(f'{self.base_url}/{endpoint}', data=data, timeout=timeout)
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/usr/lib/python3.6/site-packages/telegram/utils/request.py", line 347, in post
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     result = self._request_wrapper('POST', url, fields=data, **urlopen_kwargs)
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/usr/lib/python3.6/site-packages/telegram/utils/request.py", line 272, in _request_wrapper
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     raise BadRequest(message)
Dec 04 15:21:50 feuerstern startBot.sh[4693]: telegram.error.BadRequest: Stickerset_invalid
Dec 04 15:21:50 feuerstern startBot.sh[4693]: During handling of the above exception, another exception occurred:
Dec 04 15:21:50 feuerstern startBot.sh[4693]: Traceback (most recent call last):
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/usr/lib/python3.6/site-packages/telegram/utils/promise.py", line 77, in run
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     self._result = self.pooled_function(*self.args, **self.kwargs)
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/home/nemesisbot/Nemesis/tg_bot/modules/helper_funcs/chat_action.py", line 38, in command_func
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     return func(update, context, *args, **kwargs)
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/home/nemesisbot/Nemesis/tg_bot/modules/stickers.py", line 216, in kang
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     tgs_sticker=open("kangsticker.tgs", "rb"),
Dec 04 15:21:50 feuerstern startBot.sh[4693]:   File "/home/nemesisbot/Nemesis/tg_bot/modules/stickers.py", line 367, in makepack_internal
Dec 04 15:21:50 feuerstern startBot.sh[4693]:     emojis=emoji,
Dec 04 15:21:50 feuerstern startBot.sh[4693]: TypeError: create_new_sticker_set() got multiple values for argument 'emojis'

To Reproduce
Steps to reproduce the behavior:

  1. Send an animated sticker
  2. Execute /kang on it

Expected behavior
The bot adds the sticker to your own pack.

Version information (please complete the following information):

  • Device: Linux and Oneplus 6 and more
  • OS: openSUSE Tumbleweed, Android 10, and more
  • Telegram Version : All

Import Rose Chats

We need the ability to import Rose Chat exports, so it is easier to switch to Nemesis. I am working on this, but since I am more a Java guy some help would be welcome. A Rose chat export looks like this:

{ "bot_id": 609517172, "data": { "admin": { "legacy_admin": false }, "antiflood": { "action": "ban", "action_duration": 0, "flood_limit": 0 }, "blacklists": { "action": "nothing", "action_duration": 0, "default_reason": "", "filters": null, "should_delete": true }, "disabled": { "disabled": null, "should_delete": false }, "filters": { "filters": [ { "data_id": "", "name": "bekommst du rose", "text": "Dankeschön😘", "type": 0 }, { "data_id": "", "name": "es tut mir leid", "text": "okay... alles in Ordnung😘, aber mach es nicht nochmal!", "type": 0 }, { "data_id": "", "name": "friedensbringer", "text": "Wir sind die Friedensbringer der EOS!!!Wir werden gegen Gewalt kämpfen und immer und überall Frieden bringen, weil wir \"Friedensbringer der Eos, Retter der Welt und unglaublich mutige Helden, die in die Geschichte eingehen werden 😇\" sind!", "type": 0 }, { "data_id": "", "name": "ach stimmt ja", "text": "jedem passieren Fehler", "type": 0 }, { "data_id": "", "name": "glücklich", "text": "nein flücklich", "type": 0 }, { "data_id": "", "name": "paulchen", "text": "Total gute Freundin, Lektorin des Buches, Genossin der Aegrosso, Gründerin der KU und tolle Generälin der Allianz Tod oder Lebendig!!!", "type": 0 }, { "data_id": "", "name": "und dir?", "text": "Gut! Danke der Nachfrage.☺️", "type": 0 }, { "data_id": "", "name": "ioannis", "text": "König Griechenlands, General in der Allianz Tod oder Lebendig, Philosoph, ...😎", "type": 0 }, { "data_id": "", "name": "karatek", "text": "Exdiktator, nun ein guter Freund der Friedensbringer,König Südamerikas und cooler General der Allianz Tod oder Lebendig, der nicht immer zur GU kommt😂😉", "type": 0 }, { "data_id": "", "name": "kämpfer", "text": "Wir sind die Friedensbringer der EOS!!!Wir werden gegen Gewalt kämpfen und immer und überall Frieden bringen, weil wir \"Friedensbringer der Eos, Retter der Welt und unglaublich mutige Helden, die in die Geschichte eingehen werden 😇\" sind!", "type": 0 }, { "data_id": "", "name": "severus", "text": "Mein Exfreund und jetzt bester Kumpel, König Grönlands und der Arktis, erfolgreicher General😊😎 der Allianz Tod oder lebendig", "type": 0 }, { "data_id": "", "name": "wetter", "text": "Ist bei euch auch gerade so schönes Wetter?😁☀️", "type": 0 }, { "data_id": "", "name": "danke", "text": "gerne😘", "type": 0 }, { "data_id": "", "name": "gerne", "text": "😊👍", "type": 0 }, { "data_id": "", "name": "hallo", "text": "Einen schönen guten Tag. 😊 Wie geht es dir?", "type": 0 }, { "data_id": "", "name": "klara", "text": "Super Freundin, EOS, Königin Ozeaniens und Generälin der Allianz Tod oder Lebendig", "type": 0 }, { "data_id": "", "name": "lukas", "text": "Nervt er wieder? Wir sind doch ein Team! Er soll sich endlich benehmen!", "type": 0 }, { "data_id": "", "name": "snape", "text": "Mein Exfreund und jetzt bester Kumpel, König Grönlands und der Arktis, erfolgreicher General😊😎🥳 der Allianz Tod oder lebendig", "type": 0 }, { "data_id": "", "name": "haha", "text": "😂🤣", "type": 0 }, { "data_id": "", "name": "hehe", "text": "😂🤣", "type": 0 }, { "data_id": "", "name": "hihi", "text": "😂🤣", "type": 0 }, { "data_id": "", "name": "hoho", "text": "😂🤣", "type": 0 }, { "data_id": "", "name": "jens", "text": "Exdiktator, nun ein guter Freund der Friedensbringer, König Südamerikas und cooler General der Allianz Tod oder Lebendig, der nicht immer zur GU kommt😂😉", "type": 0 }, { "data_id": "", "name": "luna", "text": "Super Freundin, EOS, Königin Ozeaniens und Generälin der Allianz Tod oder Lebendig", "type": 0 }, { "data_id": "", "name": "nein", "text": "schade", "type": 0 }, { "data_id": "", "name": "okay", "text": "ok", "type": 0 }, { "data_id": "", "name": "rose", "text": "Ihr seid ein toller Haufen es freut mich, dass ich bei euch sein darf", "type": 0 }, { "data_id": "", "name": "silo", "text": "cooler Dude, König Nordamerikas und bester Drogendealer nördlich des Äquators", "type": 0 }, { "data_id": "", "name": "tüss", "text": "ok tschüss bis bald, bleib nicht so lange weg!😔😘", "type": 0 }, { "data_id": "", "name": "🤦‍♂", "text": "Nein lass das...das gibt Kopfschmerzen!!", "type": 0 }, { "data_id": "", "name": "!!!", "text": "!!!!!!!", "type": 0 }, { "data_id": "", "name": "...", "text": "................", "type": 0 }, { "data_id": "", "name": "hi", "text": "Einen schönen guten Tag. 😊 Wie geht es dir?", "type": 0 }, { "data_id": "", "name": "ja", "text": "freut mich", "type": 0 }, { "data_id": "", "name": "ok", "text": "ok", "type": 0 }, { "data_id": "", "name": "👍", "text": "👍", "type": 0 }, { "data_id": "", "name": "💣", "text": "Die Countdown läuft! Bald fliegt Nemesis' Rechenzentrum hoch...😈😈😈", "type": 0 }, { "data_id": "", "name": "😂", "text": "😂", "type": 0 }, { "data_id": "", "name": "😅", "text": "😂", "type": 0 }, { "data_id": "", "name": "😇", "text": "Jaja...erstmal auf unschuldig tun😅😂", "type": 0 }, { "data_id": "", "name": "😔", "text": "Nein nicht traurig sein🥺", "type": 0 }, { "data_id": "", "name": "😘", "text": "Ich will auch einen Kuss!", "type": 0 }, { "data_id": "", "name": "😡", "text": "Wir sind Friedensbringer! Wir dürfen nicht streiten!!!🥺", "type": 0 }, { "data_id": "", "name": "😢", "text": "nicht traurig sein!", "type": 0 }, { "data_id": "", "name": "😤", "text": "So eine Unverschämtheit! Das kannst du dir nicht bieten lassen!", "type": 0 }, { "data_id": "", "name": "😩", "text": "Nicht traurig sein", "type": 0 }, { "data_id": "", "name": "😫", "text": "Nicht verzweifeln...", "type": 0 }, { "data_id": "", "name": "😭", "text": "Nicht traurig sein!🥺", "type": 0 }, { "data_id": "", "name": "😱", "text": "😱", "type": 0 }, { "data_id": "", "name": "🥳", "text": "PAARTYYY🥳🥳🥳🥳🥳", "type": 0 }, { "data_id": "", "name": "🥺", "text": "nicht traurig sein!", "type": 0 }, { "data_id": "", "name": "!", "text": "!!!", "type": 0 } ] }, "greetings": { "goodbye": { "data_id": "", "disable_preview": true, "text": "", "type": 0 }, "kick_after": 0, "mute_for": 0, "mute_mode": "", "mute_text": "", "should_clean": false, "should_delete_service": false, "should_goodbye": true, "should_kick": false, "should_mute": false, "should_welcome": true, "welcome": { "data_id": "", "disable_preview": true, "text": "", "type": 0 } }, "locks": { "lock_warns": false, "locks": { "all": false, "audio": false, "bot": false, "button": false, "command": false, "contact": false, "document": false, "email": false, "emojigame": false, "forward": false, "game": false, "gif": false, "inline": false, "invitelink": false, "location": false, "phone": false, "photo": false, "poll": false, "rtl": false, "sticker": false, "text": false, "url": false, "video": false, "videonote": false, "voice": false }, "whitelisted_url": null }, "notes": { "notes": null, "private_notes": false }, "pins": { "antichannelpin": false }, "reports": { "disable_reports": false }, "rules": { "content": "Die wichtigste Regel:\nSei flücklich!\nEin paar andere Regeln...:\nKein Streit, diese Gruppe heißt nicht einfach nur so Flücklichkeit. Man darf auch niemanden unflücklich machen!", "send_to_chat": false }, "translations": { "lang": "de" }, "warns": { "action": "ban", "action_duration": 0, "warn_limit": 3 } }, "version": 1 }

It already has a function for importing Groupbuttler Backups, so maybe we could use something similar to it.

Grammar issues in German translation

The texts in /slap and /runs are partly incorrect in German. Example:
Hey, sieh dich an! Du fliehen vor dem unvermeidlichen Banhammer... Wie süß.

/afk fires messages to wrong chat

Describe the bug
When marking as afk, the message when back avaliable is sent to other chats in some cases.

To Reproduce
Steps to reproduce the behavior:

  1. Go to chat A
  2. Execute /afk
  3. Go to chat B
  4. send a message
  5. The message is sent in group B

Expected behavior
A message is sent to group A, where /afk was executed

Screenshots
Screenshot_20200911-214832.jpg
photo_2020-09-11_21-27-18

Version information (please complete the following information):

  • Device: any
  • OS: any
  • Telegram Version: any

Additional context
Possible fix may be to save the chat in which /afk is executed in the DB, and access it when the user writes sth. The message could be sent to the chat written in the DB. Problem is, database stuff needs to be changed, making updates complicated. But, as table afk_users doesn't store any persistent data, this should not be a huge issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.