Giter Site home page Giter Site logo

animekaizoku / saitamarobot Goto Github PK

View Code? Open in Web Editor NEW
342.0 342.0 1.1K 4.18 MB

An anime-themed telegram group management bot.

License: GNU General Public License v3.0

Batchfile 0.26% Python 99.74%
bot onepunchman python saitama telegram telegramgroupmanagement telegramsupport

saitamarobot's People

Contributors

1maverick1 avatar accipiter7 avatar annihilatorrrr avatar architdate avatar ayrahikari avatar bazookahub avatar celestix avatar customicon avatar dank-del avatar davinash97 avatar deepsource-autofix[bot] avatar dragsama avatar fushinori avatar guru-25 avatar jvlianodorneles avatar kshatriya-abhay avatar loli-killer avatar notfounderror avatar omar-abdul-azeez avatar paulsonoflars avatar shre-yansh avatar sitischu avatar skittles9823 avatar spechide avatar sphericalkat avatar starry-shivam avatar termozour avatar the-blank-x avatar tsunayoshisawada avatar tusharsadhwani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

saitamarobot's Issues

Bug report

creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/psutil
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=580 -DPSUTIL_LINUX=1 -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8msg74w8/psutil/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-mak6ttru-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8msg74w8/psutil/

isseu run pip3 install -r requirements.txt

just noticed an error from handlers.py is this new?

I got the following error after running bot but don't remember it before is it new or is it just because running python 12

/home/tgbot/btg/tg_bot/modules/helper_funcs/handlers.py:126: TelegramDeprecationWarning: RegexHandler is deprecated. See https://git.io/fxJuV for more info
super().init(pattern, callback, **kwargs)
/home/tgbot/.local/lib/python3.7/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: message_updates is deprecated. See https://git.io/fxJuV for more info
edited_updates=edited_updates)
/home/tgbot/.local/lib/python3.7/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)
/home/tgbot/.local/lib/python3.7/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: edited_updates is deprecated. See https://git.io/fxJuV for more info
edited_updates=edited_updates)

@Sawada sasti randi

Lawdi hai tu lawdi teri maa ki chut teri teri bhen ko nanga karke chudunga

closing won't work bitch @Sawada

๐Ÿ–•๐Ÿ–•๐Ÿ–•๐Ÿ–•๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ–•๐Ÿ–•๐Ÿ–•๐Ÿ–•๐Ÿ–•๐Ÿ–•

feds.py

I feel like I ask too much! But I was wondering can someone please help with feds.py and getting the fimport command working..

I know its probably lost a bit of attention.. but I see it working on AllMightRobot . . But I love SaitamaRobot..

For starters I should of said is it going to work ?

Bug report chat_status.py line 385

2021-02-11 10:03:12,323 - telegram.utils.promise - ERROR - An uncaught error was raised while running the promise
Traceback (most recent call last):
File "E:\SaitamaRobot\env\lib\site-packages\telegram\utils\promise.py", line 56, in run
self._result = self.pooled_function(*self.args, **self.kwargs)
File "E:\SaitamaRobot\SaitamaRobot\modules\helper_funcs\chat_status.py", line 385, in connected_status
update.effective_user.id,
AttributeError: 'NoneType' object has no attribute 'id'

SaitamaRobot all fork this is a same problem ModuleNotFoundError: No module named 'spamwatch'

[root@server SaitamaRobot]# python3 -m SaitamaRobot
Traceback (most recent call last):
File "/usr/lib64/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib64/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib64/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/root/SaitamaRobot/SaitamaRobot/init.py", line 5, in
import spamwatch
ModuleNotFoundError: No module named 'spamwatch'
[root@server SaitamaRobot]#

SaitamaRobot all fork this is a same problem ModuleNotFoundError: No module named 'spamwatch'

(PYL-W0120) Useless else clause detected on the loop

Description

When a loop specifies no break statement, the else clause will always execute when the loop sequence is empty, thus making it useless. It is recommended to have the statements under else in the same scope as the loop itself. If the else clause should not always execute at the โ€ฆ

Occurrences

There are 2 occurrences of this issue in the repository.

See all occurrences on DeepSource โ†’ deepsource.io/gh/AnimeKaizoku/SaitamaRobot/issue/PYL-W0120/occurrences/

spammer

Awww Bura Laga KR$NA bhaiya GitHub Ko PornHub Bana Dala ?

welcome.py

Could someone help every time I load welcome module I start getting these errors

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column welcome_pref.custom_content does not exist LINE 1: ...ef.should_goodbye AS welcome_pref_should_goodbye, welcome_pr...
^

Which then starts a chain reaction

Bug report self host problem centos7

Traceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/local/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/root/saitama_co7/SaitamaRobot/init.py", line 183, in
from SaitamaRobot.modules.helper_funcs.handlers import (
File "/root/saitama_co7/SaitamaRobot/modules/helper_funcs/handlers.py", line 1, in
import SaitamaRobot.modules.sql.blacklistusers_sql as sql
File "/root/saitama_co7/SaitamaRobot/modules/sql/init.py", line 15, in
SESSION = start()
File "/root/saitama_co7/SaitamaRobot/modules/sql/init.py", line 8, in start
engine = create_engine(DB_URI, client_encoding="utf8")
File "", line 2, in create_engine
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line 298, in warned
return fn(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 522, in create_engine
entrypoint = u._get_entrypoint()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 653, in _get_entrypoint
cls = registry.load(name)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 341, in load
raise exc.NoSuchModuleError(
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres

self host
centos7
plese help anyone

[welcome] Do not give welcome mute to gbanned users, only ban notice.

Is your feature request related to a problem? Please describe.
Welcome mute shows a welcome mute/welcome message to a gbanned user and follows it with a gban alert.

Describe the solution you'd like
Do not show welcome mute or custom welcome for gbanned/spamwatched ones.
Just their ban notice

fed_chats error in feds.py

I have 101 chats in my federation when I type /fedchats i get this error

2021-06-26 21:39:16,697 - telegram.utils.promise - ERROR - An uncaught error was raised while running the promise Traceback (most recent call last): File "/home/tgbot/.local/lib/python3.7/site-packages/telegram/utils/promise.py", line 56, in run self._result = self.pooled_function(*self.args, **self.kwargs) File "/home/tgbot/tg/SaitamaRobot/modules/helper_funcs/alternate.py", line 22, in command_func return func(update, context, *args, **kwargs) File "/home/tgbot/tg/SaitamaRobot/modules/feds.py", line 2072, in fed_chats chat_name = dispatcher.bot.getChat(chats).title File "/home/tgbot/.local/lib/python3.7/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "/home/tgbot/.local/lib/python3.7/site-packages/telegram/bot.py", line 67, in decorator result = func(*args, **kwargs) File "/home/tgbot/.local/lib/python3.7/site-packages/telegram/bot.py", line 2327, in get_chat result = self._request.post(url, data, timeout=timeout) File "/home/tgbot/.local/lib/python3.7/site-packages/telegram/utils/request.py", line 333, in post **urlopen_kwargs) File "/home/tgbot/.local/lib/python3.7/site-packages/telegram/utils/request.py", line 237, in _request_wrapper message = self._parse(resp.data) File "/home/tgbot/.local/lib/python3.7/site-packages/telegram/utils/request.py", line 195, in _parse raise RetryAfter(retry_after) telegram.error.RetryAfter: Flood control exceeded. Retry in 17 seconds

No app.json located in the repo URL provided

Screenshot_2020-10-22-04-04-38-480_com cloudmosa puffinFree
Screenshot_2020-10-22-04-05-08-371_com cloudmosa puffinFree

I wanted to ask that...
Just type your question here [.can u find the error ? .]
i just forked your codes and edited in my way . with a name only . balence codes are not changed till now . but , the deployment time , in heroku shown a message as "No app.json located in the repo URL provided"
but file have in there . i can show my evidences and
i can share my app"s url ,pls check and help to solve the problem

my repo url : https://github.com/sakhaavvaavaj93/saithan_Robot.git

and pls checkout the attached document
Screenshot_2020-10-22-00-35-24-414_com cloudmosa puffinFree

and pls checkout the attached document
![Uploading Screenshot_2020-10-22-00-35-24-414_com.cloudmosa.puffinFree.

afk.py

Ive just loaded the afk module but i keep hitting an error
Traceback (most recent call last):
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column afk_users.time does not exist
LINE 1: ...ers_is_afk, afk_users.reason AS afk_users_reason, afk_users....
^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/tgbot/tg/tg_bot/main.py", line 116, in
imported_module = importlib.import_module("tg_bot.modules." + module_name)
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/tgbot/tg/tg_bot/modules/afk.py", line 11, in
from tg_bot.modules.sql import afk_sql as sql
File "/home/tgbot/tg/tg_bot/modules/sql/afk_sql.py", line 97, in
__load_afk_users()
File "/home/tgbot/tg/tg_bot/modules/sql/afk_sql.py", line 89, in __load_afk_users
all_afk = SESSION.query(AFK).all()
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3373, in all
return list(self)
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in iter
return self._execute_and_instances(context)
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
distilled_params,
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in execute_context
e, statement, parameters, cursor, context
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from
=e
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise

raise exception
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/home/tgbot/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column afk_users.time does not exist
LINE 1: ...ers_is_afk, afk_users.reason AS afk_users_reason, afk_users....
^

[SQL: SELECT afk_users.user_id AS afk_users_user_id, afk_users.is_afk AS afk_users_is_afk, afk_users.reason AS afk_users_reason, afk_users.time AS afk_users_time
FROM afk_users]
(Background on this error at: http://sqlalche.me/e/13/f405)

Can anyone help?

filters.py

I wanted to ask that...
Just type your question here [...]
ive been having troubling deploying and im getting an error from filters.py in helper_funcs...

/demote doesnt work on bots that Saitama promoted

Describe the bug
When Saitama promotes a bot, it cant demote it back.
Even when Saitama is the bot that promoted it.

Happens when the target is a bot

To Reproduce
Steps to reproduce the behavior:
Promote a bot using saitama
Try to demote it
Bot wont demote and saitama will deny to recognise the bot

[/admins] Do not show bots in the admins list

Describe the bug
As bot api cant pull the list of bots in group, no need to show just saitama itself either.
Perhaps this can be edited to show something like where Saitama shows his own title too.

disasters.py

The disasters module isn't working properly..
When adding a user the bot doesn't return any messages or remove them from the old category.

It shows demote messages and the message if user is in the same category your trying to add it to. Also some messages showing if the user your demoting is in DRAGONS

Enhancement: Bot Reply to /runs Shouldn't be Roast

Replies like:

  • A long time ago, in a galaxy far far away... Someone would've cared about that. Not anymore though.
  • Is that all you've got?

takes away all the fun.

Though replies like:

  • And they disappeared forever, never to be seen again.
  • Ah, what a waste. I liked that one.

are more fun.

Thanks for reading. I hope this will be considered.

Needs exception handling

Following bugs need exception handling

 Traceback (most recent call last):
   File "/app/SaitamaRobot/modules/dev.py", line 38, in leave
     update.effective_message.reply_text("Beep boop, I left that soup!.")
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/message.py", line 515, in reply_text
     return self.bot.send_message(self.chat_id, *args, **kwargs)
   File "<decorator-gen-2>", line 2, in send_message
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/bot.py", line 67, in decorator
     result = func(*args, **kwargs)
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/bot.py", line 346, in send_message
     return self._message(url, data, disable_notification=disable_notification,
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/bot.py", line 175, in _message
     result = self._request.post(url, data, timeout=timeout)
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/utils/request.py", line 330, in post
     result = self._request_wrapper('POST', url,
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/utils/request.py", line 242, in _request_wrapper
     raise Unauthorized(message)
 telegram.error.Unauthorized: Forbidden: bot is not a member of the supergroup chat
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/utils/promise.py", line 56, in run
     self._result = self.pooled_function(*self.args, **self.kwargs)
   File "/app/SaitamaRobot/modules/helper_funcs/chat_status.py", line 107, in is_dev_plus_func
     return func(update, context, *args, **kwargs)
   File "/app/SaitamaRobot/modules/dev.py", line 40, in leave
     update.effective_message.reply_text(
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/message.py", line 515, in reply_text
     return self.bot.send_message(self.chat_id, *args, **kwargs)
   File "<decorator-gen-2>", line 2, in send_message
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/bot.py", line 67, in decorator
     result = func(*args, **kwargs)
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/bot.py", line 346, in send_message
     return self._message(url, data, disable_notification=disable_notification,
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/bot.py", line 175, in _message
     result = self._request.post(url, data, timeout=timeout)
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/utils/request.py", line 330, in post
     result = self._request_wrapper('POST', url,
   File "/app/.heroku/python/lib/python3.8/site-packages/telegram/utils/request.py", line 242, in _request_wrapper
     raise Unauthorized(message)
 telegram.error.Unauthorized: Forbidden: bot is not a member of the supergroup chat

filters.py

I wanted to ask that...
Just type your question here [...]
Im very sorry.

File "/home/tgbot/tgbot/SaitamaRobot/modules/remote_cmds.py", line 9, in
from SaitamaRobot.modules.helper_funcs.filters import CustomFilters
File "/home/tgbot/tgbot/SaitamaRobot/modules/helper_funcs/filters.py", line 6, in
class CustomFilters(object):
File "/home/tgbot/tgbot/SaitamaRobot/modules/helper_funcs/filters.py", line 11, in CustomFilters
support_filter = _Supporters()
TypeError: Can't instantiate abstract class _Supporters with abstract methods call

Bug report userinfo.py line 232

2021-02-11 10:10:29,382 - telegram.utils.promise - ERROR - An uncaught error was raised while running the promise
Traceback (most recent call last):
File "E:\SaitamaRobot\env\lib\site-packages\telegram\utils\promise.py", line 56, in run
self._result = self.pooled_function(*self.args, **self.kwargs)
File "E:\SaitamaRobot\SaitamaRobot\modules\userinfo.py", line 232, in info
and not message.parse_entities([MessageEntity.TEXT_MENTION])
NameError: name 'MessageEntity' is not defined
1044879856

Bump Support to Telegram 12.x

Its you guys planing to update support to python_telegram_bot==12.5.1 ?

Getting warnings and AttributeError errors on 12.5.1

super().__init__(pattern, callback, **kwargs) /data/bots/.local/lib/python3.7/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: message_updates is deprecated. See https://git.io/fxJuV for more info edited_updates=edited_updates) /data/bots/.local/lib/python3.7/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) /data/bots/.local/lib/python3.7/site-packages/telegram/ext/regexhandler.py:121: TelegramDeprecationWarning: edited_updates is deprecated. See https://git.io/fxJuV for more info edited_updates=edited_updates) /data/bots/Bob/tg_bot/modules/helper_funcs/handlers.py:56: TelegramDeprecationWarning: edited_updates is deprecated. See https://git.io/fxJuV for more info super().__init__(filters, callback, **kwargs)

Thanks in advance

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.