Skip to content

Telegram Warn Bot made with C# @fancy_moderator_bot

License

Notifications You must be signed in to change notification settings

Geras1mleo/TelegramWarnBot

Repository files navigation

Telegram Warn Bot

Telegram Warn Bot made with C# and ♥ by Geras1mleo

What can I do?

I am a bot-moderator...

I keep track of the warnings and automatically ban members when the maximum amount of warnings has been reached.

First of all you have to add me into your chat. To use a default one, search for @fancy_moderator_bot

Promote me to admin and /warn the bad guy by replying to his message or by mentioning @bad_guy in your command. I will ban users who receive more than a certain number of warnings specified in Configuration.json.

The default value of MaxWarnings is 3, which means that the user will be banned on his 3rd warning.

If the bad guy behaves less badly, you can /unwarn him in the same way. If a member is already banned from chat, I will unban him so he can get back into the group.

All members can check their number of warnings by typing /wcount, or /wcount @bad_guy to check the number of warnings of someone else.

The commands /warn and /unwarn are only available to administrators and the owner of the group.

I can also:
delete "User joined/left chat" - messages...
delete spam (external links / URL's and mentions) of newly joined members (<24 hours in chat, See: NewMemberStatusFromHours)

Triggers

I will look at the messages in one specific chat (or any chat) and respond/trigger to the most offensive/provocative/funny ones.

Illegal Triggers

I will look at the messages in the chat and notify admins (in private messages) if something illegal has been sent in one specific chat (or any chat). I will delete messages with illegal words and optionally also give an auto warning to the sender.

Usage

Modify json configuration files according to your needs:

Replace <Telegram Bot Token> by your own token.

Here are some significant settings for the bot. You can change them at runtime and then use reload in console to reload new configurations.

Messages that will trigger the bot and send a response to corresponding chat with a triggered message attached in reply of response message.

  • Chat: Chat to which the trigger is applicable or null (any chat).
  • Messages: Messages array that will trigger the bot.
  • Responses: Reactions (1 random response from set) of the bot to the member who triggered it.
  • MatchCase: Whether message must match upper/lower case to trigger.
  • MatchWholeMessage: Whether message must match whole message to trigger.

Notification is sent to admins (optional Warn sender) when an illegal word is sent in a specific chat (or any chat).

Console Features

  • send <Message> => Sending message into one specific chat or all cached chats.
    • <Message> => Message to send. Please use "" to indicate message. Markdown formating allowed.
    • -c | --chat => Chat with according Chat Id. If not specified, message is sent to all chats.

Example: send -c 123456 "Example message" or send "Hello World!"

  • register <Chat Id> => Manipulate registered chats:
    • <Chat Id> => Chat to (add to / remove from) the list.
    • -l | --list => Show the list of registered chats.
    • -r | --remove => Remove one specific chat from list.

Example: register 123456 or register -rm "-69420"

  • leave / l <Chat Id> => Leave a specific chat.
    • <Chat Id> => Chat that bot will leave.

Example: leave 123456 or l "-69420"

Like the project?

Give it a ⭐ Star!

Found a bug?

Drop to Issues
Or: sviatoslav.harasymchuk@gmail.com

Thanks in advance!