-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
100 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
from discord.utils import maybe_coroutine | ||
from __future__ import annotations | ||
from typing import TYPE_CHECKING | ||
|
||
from redbot.core.errors import CogLoadError | ||
|
||
from .maps import Maps | ||
|
||
if TYPE_CHECKING: | ||
from redbot.core.bot import Red | ||
|
||
__red_end_user_data_statement__ = "This cog does not persistently store data about users." | ||
|
||
|
||
async def setup(bot): | ||
await maybe_coroutine(bot.add_cog, Maps()) | ||
async def setup(bot: Red) -> None: | ||
if not getattr(bot, "session", None): | ||
raise CogLoadError("This cog requires bot.session attr to be set.") | ||
await bot.add_cog(Maps()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import discord | ||
from redbot.core import commands | ||
|
||
|
||
class MapFlags(commands.FlagConverter, prefix="-", delimiter=" "): | ||
location: str | None = commands.flag( | ||
default=None, | ||
description="Input a location name that is available on Google Maps.", | ||
positional=True, | ||
) | ||
zoom: int = commands.flag( | ||
default=12, | ||
description="Zoom level of the map, from 1 to 20. Defaults to 12.", | ||
max_args=1, | ||
) | ||
map_type: str = commands.flag( | ||
default="roadmap", | ||
description="The type or format of the map, either 'roadmap' (default), 'satellite', 'terrain' or 'hybrid'", | ||
max_args=1, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
{ | ||
"name": "Google Maps", | ||
"short": "Fetch a Google map of a specific location.", | ||
"description": "Fetch a Google map of a specific location in various modes.", | ||
"short": "Fetch map of a location from Google Maps.", | ||
"description": "Fetch map of a location from Google Maps in various modes.", | ||
"end_user_data_statement": "This cog does not persistently store data or metadata about users.", | ||
"install_msg": "Hi, thanks for installing my Maps cog. Please note that this cog requires some setup to do on your part to get a free API key, mainly to enable Maps API. If you can figure that out on your own, that's genius, but if you find yourself struggling on how to enable it and still want to use this cog, you can ask me on Discord for help. I'll try my best to help you out.", | ||
"author": ["siu3334"], | ||
"author": ["owocado"], | ||
"required_cogs": {}, | ||
"requirements": [], | ||
"tags": ["maps", "map", "google map", "google maps"], | ||
"min_bot_version": "3.4.0", | ||
"hidden": false, | ||
"min_bot_version": "3.6.0", | ||
"min_python_version": [ | ||
3, | ||
12, | ||
0 | ||
], | ||
"hidden": true, | ||
"disabled": false, | ||
"type": "COG" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters