Giter Club home page Giter Club logo

myproject's People

Contributors

hummer82 avatar

Stargazers

 avatar

Watchers

 avatar

myproject's Issues

New

from aiogram import Bot, Dispatcher, executor, types
from aiogram.types.web_app_info import WebAppInfo
import sys
mypath = '/storage/emulated/0/Documents/myproject'
sys.path.append(mypath)

import sqlmy

bot = Bot("6513613001:AAHZZ4GtQwRXpctL7L_KHasq1QRToDX-UY8")
dp = Dispatcher(bot)

myid = 0
myconndb = sqlmy.ConnMy(mypath+'/my_database.db')

@dp.message_handler(commands=['web'])
async def website(message: types.Message):
await message.answer(f'{message}')

@dp.message_handler(commands=['start','menu'])
async def start(message: types.Message):
global myconndb
myconndb.close()
markup = types.InlineKeyboardMarkup(row_width=2)
markup.add(types.KeyboardButton('Открыть сайт', web_app=WebAppInfo(url='https://rc44.ru')))
markup.add(types.KeyboardButton('Написать менеджеру', callback_data='send_manager'))
markup.add(types.KeyboardButton('Создать заказ', callback_data='create_order'))
markup.add(types.KeyboardButton('Вход', callback_data='login'))
fn = message.chat.first_name if message.chat.first_name != None else ""
ln = message.chat.last_name if message.chat.last_name != None else ""
await message.answer(f'{fn} {ln}, выберите действие\n{message}',reply_markup=markup)

@dp.callback_query_handler()
async def sendmanager(call):
if call.data == 'send_manager':
global myid
myid = call.message.chat.id
await bot.send_message(6039681226,f'От:{call.message.from_user.first_name} {call.message.from_user.last_name} {myid}\n /6039681226')
else:
await call.message.answer(call)

@dp.message_handler(content_types=['text','photo','video','voice'])
async def mess(message: types.Message):
global myid
#reply_id = message.chat.id
await bot.send_message(myid,message.text)
# if int(message.reply_to_message['from']['id']) != int(message['from']['id']):
# await bot.send_message(message.reply_to_message['from']['id'], message.text)
# else:
# await message.answer(message)

executor.start_polling(dp)

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.