Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
35 changes: 35 additions & 0 deletions projects/Team-5-IFipBot/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
*Team name
IFTip Bot

*Product direction
A Telegram & Discord Tip Bot supports Near Aurora (ETH & ERC20 Tokens)

*Introduction
IFTip Bot create HD wallet by create random mnemonic words for each user. We integrate Aurora's wallet and contract interaction in IFTip Bot, and supports actions on Aurora:

1. Create wallet in very low threshold
2. Tip friends with Aurora ETH & ERC20 Tokens
3. Airdrop red packets to group users
4. Query price of Near and other tokens

*Github link
https://github.com/bibodeng/Layer2Hackathon

*Demo link
Telegram Bot: https://t.me/iftip_bot
Discord Bot: https://dsc.gg/iftip-bot
Demo Video: https://sourl.cn/rQnsMq

*Ethereum Wallet Address
0x798953fF89C0cDDe6681977c9b7321eFE1E87d0e

Twitter handle
@bibodeng

Website
https://iftip.io

Team information
Let us know your team composition and everyone's responsibility

[ A ] bibodeng, product manager and programmer
126 changes: 126 additions & 0 deletions projects/Team-5-IFipBot/iftip_bot/telegram/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import re
import hashlib

from sqlalchemy import or_
from sqlalchemy import and_

from flask import current_app
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import MessageHandler
from telegram.ext import Filters

from app.ext import db
from app.models import *
from app.utils import asset
from app.utils import ifwallet
from app.utils import reg as reg_utils
from app.utils.utils import *
from app.utils import cet
from app.utils import cet_dex
from app.utils import coin_exchange
from app.utils.cmc import get_price_cmc
from app.utils.telegram_sdk import get_chat_member_count
from app.utils.telegram_sdk import get_chat_administrators
from app.utils.exceptions import BusinessError

from app.utils.enums.coin_type import CoinType
from app.utils.enums.coin_type import Blockchain
from app.utils.enums.currency_type import CurrencyType

platform = 'telegram'
default_coin_type = 'ETH-AURORA'

def command_help(update, context):
add_group_member(update)
if len(context.args) == 1:
topic = context.args[0]
if topic == 'price':
handle_price_help(update)
elif topic == 'deposit':
handle_deposit_help(update)
elif topic == 'withdraw':
handle_withdraw_help(update)
elif topic == 'tip':
handle_tip_help(update)
elif topic == 'rain':
handle_rain_help(update)
elif topic == 'password':
handle_password_help(update)
elif topic == 'pair':
handle_swap_pair_help(update)
elif topic == 'swap':
handle_swap_help(update)
elif topic == 'bind_mobile':
handle_bind_mobile_help(update)
elif topic == 'verify_mobile':
handle_verify_mobile_help(update)
elif topic == 'switch_wallet':
handle_switch_wallet_help(update)

return

def command_deposit(update, context):
add_group_member(update)

if context.args:
coin_type = context.args[0].upper()
datas = {'coin': coin_type}
handle_deposit(update, datas)
else:
handle_deposit_help(update)

def command_withdraw(update, context):
add_group_member(update)
if context.args:
datas = {
"amount": quantize(context.args[0], 8),
"coin": context.args[1],
"address": context.args[2],
"memo": context.args[3] if len(context.args) == 4 else None
}
handle_withdraw(update, datas)
else:
handle_withdraw_help(update)

def command_balance(update, context):
add_group_member(update)
if context.args:
datas = {'coin': context.args[0]}
handle_balance(update, datas)
else:
handle_balance(update, datas={})

def command_tip(update, context):
add_group_member(update)
handle_tip_help(update)

def command_rain(update, context):
try:
add_group_member(update)
if len(context.args) == 4:
datas = {
'share': context.args[0],
'amount': context.args[2],
'coin': context.args[3]
}
handle_rain(update, datas)
else:
handle_rain_help(update)
except:
current_app.logger.exception('command_rain fail')

def command_password_red_packet(update, context):
add_group_member(update)
if len(context.args) == 5:
datas = {
'share': context.args[0],
'amount': context.args[2],
'coin': context.args[3],
'password': context.args[4].replace('#', '')
}
handle_password_red_packet(update, datas)
else:
handle_password_help(update)


Loading