понял в чём была проблема

This commit is contained in:
Marsh232 2022-09-12 01:26:18 +03:00
parent 3f637f5de9
commit 3469a90137
3 changed files with 21 additions and 6 deletions

22
.idea/workspace.xml generated
View File

@ -4,8 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="56d3644b-12ed-4137-967a-9e3a3c12d93b" name="Changes" comment="Начал добовлять в телеграм"> <list default="true" id="56d3644b-12ed-4137-967a-9e3a3c12d93b" name="Changes" comment="Начал добовлять в телеграм 2">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config.py" beforeDir="false" afterPath="$PROJECT_DIR$/config.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -112,7 +113,8 @@
<workItem from="1662542574124" duration="3363000" /> <workItem from="1662542574124" duration="3363000" />
<workItem from="1662648763510" duration="5935000" /> <workItem from="1662648763510" duration="5935000" />
<workItem from="1662886058001" duration="5482000" /> <workItem from="1662886058001" duration="5482000" />
<workItem from="1662931348193" duration="2530000" /> <workItem from="1662931348193" duration="2714000" />
<workItem from="1662934797487" duration="309000" />
</task> </task>
<task id="LOCAL-00001" summary="Add basic output"> <task id="LOCAL-00001" summary="Add basic output">
<created>1662545492088</created> <created>1662545492088</created>
@ -149,7 +151,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1662898384606</updated> <updated>1662898384606</updated>
</task> </task>
<option name="localTasksCounter" value="6" /> <task id="LOCAL-00006" summary="Начал добовлять в телеграм 2">
<created>1662934101339</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1662934101339</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -172,20 +181,21 @@
<MESSAGE value="add func subnets" /> <MESSAGE value="add func subnets" />
<MESSAGE value="Add subnets" /> <MESSAGE value="Add subnets" />
<MESSAGE value="Начал добовлять в телеграм" /> <MESSAGE value="Начал добовлять в телеграм" />
<option name="LAST_COMMIT_MESSAGE" value="Начал добовлять в телеграм" /> <MESSAGE value="Начал добовлять в телеграм 2" />
<option name="LAST_COMMIT_MESSAGE" value="Начал добовлять в телеграм 2" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line"> <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/main.py</url> <url>file://$PROJECT_DIR$/main.py</url>
<line>49</line> <line>52</line>
<option name="timeStamp" value="1" /> <option name="timeStamp" value="1" />
</line-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
</component> </component>
<component name="com.intellij.coverage.CoverageDataManagerImpl"> <component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/Telegram_IP_CALC$main.coverage" NAME="main Coverage Results" MODIFIED="1662933907219" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/Telegram_IP_CALC$main.coverage" NAME="main Coverage Results" MODIFIED="1662935064255" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component> </component>
</project> </project>

View File

@ -1 +1,2 @@
TOKEN = '5631324818:AAEcOp7ZPzeSQReLk7rwnAT89n76ld05Jko' # bot token TOKEN = '5631324818:AAEcOp7ZPzeSQReLk7rwnAT89n76ld05Jko' # bot token

View File

@ -3,6 +3,9 @@ import telebot
import ipaddress import ipaddress
bot = telebot.TeleBot(config.TOKEN) bot = telebot.TeleBot(config.TOKEN)
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, 'Привет')
def main(ip): def main(ip):
list_ip = ip.split('/') # Разделяет вводимый ip на часть с маской, и без list_ip = ip.split('/') # Разделяет вводимый ip на часть с маской, и без
@ -42,6 +45,7 @@ def subnets(ip, prefix):
if __name__ == '__main__': if __name__ == '__main__':
bot.polling(none_stop=True)
addr = input('Введите ip: ') # Пользователь вводит ip addr = input('Введите ip: ') # Пользователь вводит ip
main(addr) main(addr)
# Тут должна быть кнопка типа "Подсети" # Тут должна быть кнопка типа "Подсети"