data = {'name': (None, name), 'description': (None, 'упс'), 'img': open(name+'.jpg', 'rb')}
r = requests.post(url, files=data)
@bot.callback_query_handler(func = lambda call: True)
def callback_inline(call):
global first
first = ["Well done! Now I have to define your name.", "ikki"]
if call.data == 'eng':
first = str(first[0])
main(call)
elif call.data == 'ru':
first = str(first[1])
main(call)
elif call.data == 'yes':
bot.edit_message_text('Отлично', call.message.chat.id, call.message.message_id)
body()
else:
bot.edit_message_text('Плохо', call.message.chat.id, call.message.message_id)
body()
try:
chat = await client(ResolveUsernameRequest(username))
result = {
'chat_id': chat.peer.channel_id,
'access_hash': chat.chats[0].access_hash,
'title': chat.chats[0].title,
'username': username
}
except Exception as e:
result = None
ResolveUsernameRequest
не резолвит id из joinchat ссылки.from telethon.tl.functions.messages import CheckChatInviteRequest
chat = client(CheckChatInviteRequest('XXXXXXXXXXXX'))
headers = ['Название продукции', 'Количество продукции']
n = int(input('Введите кол-во наименований: '))
with open('file.csv', 'w', newline = '') as csvfile:
writer = csv.writer(csvfile, delimiter = ';')
writer.writerow(headers)
for _ in range(n):
name = input('Введите название: ')
count = input('Кол-во: ')
writer.writerow([name, count])
dynos
, в котором будут два ключа: carno и maia. Ну и потом просто получать их. dinos = {'carno': { 'weight': 2170, 'health': 2170, 'bite': 200, 'bleed': 15, 'sbite': 0, 'sbleed': 0 }, 'maia': { 'weight': 2868, 'health': 2868, 'bite': 175, 'bleed': 0, 'sbite': 0, 'sbleed': 0 }}
d1=dinos[input()]
for message.author in guild.members
if message.channel.type == discord.DMChannel:
if isinstance(message.channel, discord.DMChannel):
message.author
@bot.event
async def on_message(message):
if message.author.bot:
return
if isinstance(message.channel, discord.DMChannel):
await message.author.send("message")
import requests
data = requests.get('https://steamcommunity.com/market/listings/730/AK-47%20%7C%20Redline%20%28Field-Tested%29/render/?query=&start=60&count=10&country=RU&language=english¤cy=1').json()
for skin in data['assets']['730']['2'].values():
if 'fraudwarnings' in skin:
for fraudwarning in skin['fraudwarnings']:
if fraudwarning.startswith('Name Tag'):
print(fraudwarning.replace('Name Tag: ', '').replace('\'\'', ''))
else:
print(skin['name'])