https://github.com/santaspeen/triple-send
Send to Telegram, Vk, Discord
https://github.com/santaspeen/triple-send
discord python3 telegram vk
Last synced: about 2 months ago
JSON representation
Send to Telegram, Vk, Discord
- Host: GitHub
- URL: https://github.com/santaspeen/triple-send
- Owner: SantaSpeen
- License: mit
- Created: 2022-03-02T08:15:05.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-05T23:32:58.000Z (over 4 years ago)
- Last Synced: 2025-05-31T17:55:05.839Z (about 1 year ago)
- Topics: discord, python3, telegram, vk
- Language: Python
- Homepage:
- Size: 184 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Triple send
##### Версия для русских: [здесь](./README_RU.md)
Demo:
* Telegram: @Triple_project_bot
* Discord: Triple project#0877
* Vkontakte: @dev.santaspeen
### How to run
* Install requirements
```shell
$ python3.9 -m pip install -r requirements.txt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
...
```
```python
import triple
# default vk_api_version is 5.131
tr = triple.Triple(
vk_token="Token here", # Default None
tg_token="Token here", # Default None
ds_token="Token here", # Default None
prefix=".", # default '.'
config_path="./config/polling.json" # Default './config/polling.json'. This mean /config/polling.json'.
)
@tr.on_message("echo")
def bot_echo(event_type: str, event: triple.types.MessageObject):
""" example """
# Triggered from '.echo'
# Available event_types:
# tg_event
# vk_event
# ds_event
if event_type == "vk_event":
return f"Event type: {event_type}\n\nMessage: {event.text}\n\nEvent: {event!r}"
return f"Event type: `{event_type}`\n\nMessage: `{event.text}`\n\nEvent: `{event!r}`"
@tr.on_message(r"((?:\.help|/help|/start))", regex=True)
def bot_help(event_type: str, event: triple.types.MessageObject):
message = "Help:\n1: .echo {0}{0}"
if event_type == "vk_event":
return message.format("")
return message.format('`')
@tr.on_event
async def all_events(event_from: str, event):
print(event_from, event)
if __name__ == '__main__':
tr.run()
```
## Links
* [Author's Telegram](https://t.me/SantaSpeen "SantaSpeen"): https://t.me/SantaSpeen