Minor typos fixes

This commit is contained in:
Suren Khorenyan 2018-02-11 12:50:28 +03:00
parent 05399ecaa1
commit 3c99b171f6
7 changed files with 20 additions and 21 deletions

View file

@ -1,13 +1,12 @@
import asyncio
import logging
import os
import logging
from http import HTTPStatus
import aiohttp
from .. import types
from ..utils import exceptions
from ..utils import json
from ..utils import exceptions
from ..utils.helper import Helper, HelperMode, Item
# Main aiogram logger

View file

@ -60,7 +60,7 @@ class Bot(BaseBot):
typing.Union[typing.List[base.String], None] = None) -> typing.List[types.Update]:
"""
Use this method to receive incoming updates using long polling (wiki).
Notes
1. This method will not work if an outgoing webhook is set up.
2. In order to avoid getting duplicate updates, recalculate offset after each server response.
@ -132,7 +132,7 @@ class Bot(BaseBot):
async def get_webhook_info(self) -> types.WebhookInfo:
"""
Use this method to get current webhook status. Requires no parameters.
If the bot is using getUpdates, will return an object with the url field empty.
Source: https://core.telegram.org/bots/api#getwebhookinfo
@ -180,7 +180,7 @@ class Bot(BaseBot):
:type chat_id: :obj:`typing.Union[base.Integer, base.String]`
:param text: Text of the message to be sent
:type text: :obj:`base.String`
:param parse_mode: Send Markdown or HTML, if you want Telegram apps to show bold, italic,
:param parse_mode: Send Markdown or HTML, if you want Telegram apps to show bold, italic,
fixed-width text or inline URLs in your bot's message.
:type parse_mode: :obj:`typing.Union[base.String, None]`
:param disable_web_page_preview: Disables link previews for links in this message
@ -190,7 +190,7 @@ class Bot(BaseBot):
:param reply_to_message_id: If the message is a reply, ID of the original message
:type reply_to_message_id: :obj:`typing.Union[base.Integer, None]`
:param reply_markup: Additional interface options.
:type reply_markup: :obj:`typing.Union[types.InlineKeyboardMarkup,
:type reply_markup: :obj:`typing.Union[types.InlineKeyboardMarkup,
types.ReplyKeyboardMarkup, types.ReplyKeyboardRemove, types.ForceReply, None]`
:return: On success, the sent Message is returned.
:rtype: :obj:`types.Message`

View file

@ -18,8 +18,8 @@ class Audio(base.TelegramObject, mixins.Downloadable):
def __hash__(self):
return hash(self.file_id) + \
self.duration + \
hash(self.performer) + \
hash(self.title) + \
hash(self.mime_type) + \
self.file_size
self.duration + \
hash(self.performer) + \
hash(self.title) + \
hash(self.mime_type) + \
self.file_size

View file

@ -40,7 +40,7 @@ class Chat(base.TelegramObject):
@property
def mention(self):
"""
Get mention if dialog have username or full name if this is Private dialog otherwise None
Get mention if a Chat has a username, or get full name if this is a Private Chat, otherwise None is returned
"""
if self.username:
return '@' + self.username
@ -51,7 +51,7 @@ class Chat(base.TelegramObject):
@property
def user_url(self):
if self.type != ChatType.PRIVATE:
raise TypeError('This property available only in private chats.')
raise TypeError('`user_url` property is only available in private chats!')
return f"tg://user?id={self.id}"

View file

@ -15,8 +15,8 @@ class BaseField(metaclass=abc.ABCMeta):
:param base: class for child element
:param default: default value
:param alias: alias name (for e.g. field named 'from' must be has name 'from_user'
('from' is builtin Python keyword)
:param alias: alias name (for e.g. field 'from' has to be named 'from_user'
as 'from' is a builtin Python keyword
"""
self.base_object = base
self.default = default
@ -34,7 +34,7 @@ class BaseField(metaclass=abc.ABCMeta):
def get_value(self, instance):
"""
Get value for current object instance
Get value for the current object instance
:param instance:
:return:

View file

@ -18,8 +18,8 @@ class MessageEntity(base.TelegramObject):
def _apply(self, text, func):
return text[:self.offset] + \
func(text[self.offset:self.offset + self.length]) + \
text[self.offset + self.length:]
func(text[self.offset:self.offset + self.length]) + \
text[self.offset + self.length:]
def apply_md(self, text):
"""

View file

@ -14,13 +14,13 @@ dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def send_welcome(message: types.Message):
# So... By first i want to send something like that:
# So... At first I want to send something like this:
await message.reply("Do you want to see many pussies? Are you ready?")
# And wait few seconds...
await asyncio.sleep(1)
# Good bots always must be send chat actions. Or not.
# Good bots should send chat actions. Or not.
await ChatActions.upload_photo()
# Create media group