Skip to content

Commit

Permalink
Update 0.2.9
Browse files Browse the repository at this point in the history
added LibreGroupHelp wiki for users and developers documentation
better jsdocs on GHBot.js
  • Loading branch information
Sp3rick committed Sep 1, 2024
1 parent 4292eae commit 158f435
Show file tree
Hide file tree
Showing 43 changed files with 2,835 additions and 979 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
71 changes: 0 additions & 71 deletions CONFIG_DOCUMENTATION.md

This file was deleted.

202 changes: 73 additions & 129 deletions GHbot.js

Large diffs are not rendered by default.

105 changes: 13 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
## LibreGroupHelp
# LibreGroupHelp

Open-Source re-creation of telegram group manager Group Help in NodeJS based on [node-telegram-api](https://github.com/yagop/node-telegram-bot-api).

An official instance of bot is running on [@LibreGroupHelpBot](https://t.me/LibreGroupHelpBot)

## Installation:

```bash
npm install
```
Be sure to have installed a recent version of [NodeJS](https://nodejs.org/)

Set your bot token on config.js, look at [config documentation](https://github.com/Sp3rick/GroupHelp/blob/main/CONFIG_DOCUMENTATION.md).
Verify NodeJS installation with `node -v`

Run with:
```bash
node index.js
```
Set your bot token using configuration file, look at [config documentation](configuration.md).

Installation trubleshooting:
Open a terminal inside LibreGroupHelp folder and run this commands

if you have problems with node-telegram-bot-api installation try this command url based:
```bash
npm i https://github.com/yagop/node-telegram-bot-api
npm install
```

and if needed install other packages manually:
Now you should be ready to run LibreGroupHelp using:
```bash
npm i chrono-node
node index.js
```

## Contribute

Useful links to contribute:

[documentation.md](https://github.com/Sp3rick/GroupHelp/blob/main/documentation.md).

[Create a plugin](https://github.com/Sp3rick/GroupHelp/blob/main/plugins.md).

[TODO (good first issue)](https://github.com/Sp3rick/GroupHelp/contribute).


## What is done

Expand Down Expand Up @@ -97,75 +81,12 @@ Useful links to contribute:
```

## Updating
To update the bot you need to backup ./database folder and ./config.json only, then repeat installation process and paste there the old database and config.json, you may need to add some config.json parameters manually


## Our TODO List:

-short term:

allow to edit single user perms
commands help panel

-medium term:

allow on /perms to change user perms and roles, +add it in a button for /info or when a role is set (/free /mod etc..), +ask double confirm to give an user the "settings" and "roles" permission
support for anonymous admins
allow to customize /staff allowing to set roles to hide
create a privacy setting where users can ask to esclude themself from tagResolver and replace his's first name in database with "Anonymous"
allow to disable tagResolver log on group settings
allow to mute only media, or specific media type or extras
create a privacy option to allow a user deleting his data from the bot
custom roles
optimize database.get, .update and .save to store in temporal array most used users
implement time zone setting +implement it in /info

-long term:

add log channel
chatIds anonymization on database
compress chats data stored on database
support all group help functions and more (+anti-sheduled messages[msg.is_from_offline], )
allow bot clone bot when user give a token
add optionally an userbot (when active implement in tagResolver.js)

-other things:

implement direct private settings with /*settings
add a /commands command to help user to know bot commands, admin commands, and custom-group commands if avaiable
a check system to drop wrong formatted cb.data and waitingReply
allow to see perms calculation trough user perms, then roles by priority, then base group perms, going from left to right (or opposite)
add something to allow a group admin to identify all users with additional bot perms
?add an automatic leveling system for admins? (maybe?)
add photo preview-mode in MessageMaker.js
allow to warn only usersIds who exhist on telegram, it can be checked if applyng a restriction returns true
add config to allow/disallow adding bot from non-admin users
?identify reply_parameters and add everytime allow_sending_without_reply? (GHBot.js)
/geturl, by replying to a message (via reply) and writing this command, you receive the link that refers directly to that message.
/inactives [days] sends in private chat the list of users who have not sent a message in the last [days], with the possibility of punish them.
/pin [message] - sends the message through the Bot and pins it.
/editpin [message] - edits the current pinned message (if sent from the Bot).
/delpin - removes the pinned message.
/repin - removes and pins again the current pinned message, with notification!
/pinned - refers to the current pinned message.
/list - sends in private chat the list of users of the group with the number of messages sent by them.
/list roles - sends in private chat the list of all the special roles assigned to users
/graphic - sends a graph showing the trend of the group members.
/trend - sends the group's growth statistics.
/logdel - deletes the selected message and sends it to the Log Channel
/send - permits to send a post through the Bot with parse mode support

## Known possible bugs:
-sometimes db.chats.update in plugins may be not used at all because you can still edit the global object cause to reference, not using it may cause some issue. +if global reference get cleared too early code may try to access and inexistent variable

-cleanHTML() may be not applyed in some text where it should, and nothing assure that it's 100% able to clean everything needed for telegram api

-if you add a new permission on userPerms object, every userPerms object should be updated adding that, otherwise this may cause incorrect result in sumUserPerms

-in some unkown cases you may get stuck in exceptions menu and SafeGram.js will block any user request due too high accumulated volume of something pending

-permissions setup on first bot adding to groups is not the same as using /reload that's more complete

To update LibreGroupHelp you need to backup ./database folder and ./config.json, then repeat installation process and paste there again both file and folder, you may need to add some config.json parameters manually if has been added

## Contribute

[Documentation](../documentation/) is the section you are looking for if you want to contribute to LibreGroupHelp

## Ask a question

Expand Down
12 changes: 12 additions & 0 deletions docs/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
Binary file added docs/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 158f435

Please sign in to comment.