Beispiel #1
0
 async def search_place(self, ctx, *place):
     wiki_message = self.show_wiki
     image = self.show_map
     place = ' '.join(place)
     embed = discord.Embed(title=place, color=0x9400d3)
     if self.show_wiki:
         content, url = wiki_page(place)
         wiki_message = "{0}\n{1}".format(content, url)
         embed.description = wiki_message
     if self.show_map:
         info = find_object_info(place).json()
         coordinates = find_object_coordinates(info)
         delta = find_delta(info)
         image = take_map_picture(coordinates, delta, self.map_type,
                                  self.point_type)
         embed.set_image(url=image.url)
     await ctx.send(embed=embed)
Beispiel #2
0
 async def random_city(self, ctx):
     wiki_message = self.show_wiki
     image = self.show_map
     city = random.choice(CITIES)
     embed = discord.Embed(title=city, color=0x9400d3)
     if self.show_wiki:
         content, url = wiki_page(city)
         wiki_message = "{0}\n{1}".format(content, url)
         embed.description = wiki_message
     if self.show_map:
         info = find_object_info(city).json()
         coordinates = find_object_coordinates(info)
         delta = find_delta(info)
         image = take_map_picture(coordinates, delta, self.map_type,
                                  self.point_type)
         embed.set_image(url=image.url)
     await ctx.send(embed=embed)
Beispiel #3
0
 async def learning_sea(self, ctx):
     await ctx.send('Давайте изучим ' + str(self.count) + ' моря(-ей)')
     for i in range(self.count):
         wiki_message = self.show_wiki
         image = self.show_map
         sea = random.choice(SEA)
         embed = discord.Embed(title=sea, color=0x9400d3)
         if self.show_wiki:
             content, url = wiki_page(sea)
             wiki_message = "{0}\n{1}".format(content, url)
             embed.description = wiki_message
         if self.show_map:
             info = find_object_info(sea).json()
             coordinates = find_object_coordinates(info)
             delta = find_delta(info)
             image = take_map_picture(coordinates, delta, self.map_type,
                                      self.point_type)
             embed.set_image(url=image.url)
         await ctx.send(str(i + 1) + ' море')
         await ctx.send(embed=embed)