Skip to content

Commit

Permalink
[All cogs] Improve support for new markdown
Browse files Browse the repository at this point in the history
Discord is gradually improving support for Markdown over the next few days, adding numbered lists & bullet lists
  • Loading branch information
Vexed01 committed Apr 25, 2023
1 parent 03091df commit b5aedfa
Show file tree
Hide file tree
Showing 18 changed files with 183 additions and 172 deletions.
4 changes: 2 additions & 2 deletions aliases/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ async def aliases(self, ctx: commands.Context, *, strcommand: str):
server aliases.
**Examples:**
- `[p]aliases foo`
- `[p]aliases foo bar`
- `[p]aliases foo`
- `[p]aliases foo bar`
"""
command = self.bot.get_command(strcommand)

Expand Down
24 changes: 12 additions & 12 deletions anotherpingcog/anotherpingcog.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ async def red(self, ctx: commands.Context, emoji: str, hex_colour: str = "defaul
same colour as the emoji. Google "hex colour" if you need help with this.
**Examples:**
- `[p]pingset red :emoji: #F04747`
- `[p]pingset red :emoji: default`
- `[p]pingset red default #F04747`
- `[p]pingset red default default`
- `[p]pingset red :emoji: #F04747`
- `[p]pingset red :emoji: default`
- `[p]pingset red default #F04747`
- `[p]pingset red default default`
"""

if emoji.casefold() == "default":
Expand Down Expand Up @@ -347,10 +347,10 @@ async def orange(self, ctx: commands.Context, emoji: str, hex_colour: str = "def
same colour as the emoji. Google "hex colour" if you need help with this.
**Examples:**
- `[p]pingset orange :emoji: #FAA61A`
- `[p]pingset orange :emoji: default`
- `[p]pingset orange default #FAA61A`
- `[p]pingset orange default default`
- `[p]pingset orange :emoji: #FAA61A`
- `[p]pingset orange :emoji: default`
- `[p]pingset orange default #FAA61A`
- `[p]pingset orange default default`
"""
if emoji.casefold() == "default":
await self.config.custom_settings.set_raw("orange", "emoji", value=None) # type:ignore
Expand Down Expand Up @@ -416,10 +416,10 @@ async def green(self, ctx: commands.Context, emoji: str, hex_colour: str = "defa
same colour as the emoji. Google "hex colour" if you need help with this.
**Examples:**
- `[p]pingset green :emoji: #43B581`
- `[p]pingset green :emoji: default`
- `[p]pingset green default #43B581`
- `[p]pingset green default default`
- `[p]pingset green :emoji: #43B581`
- `[p]pingset green :emoji: default`
- `[p]pingset green default #43B581`
- `[p]pingset green default default`
"""
if emoji.casefold() == "default":
await self.config.custom_settings.set_raw("green", "emoji", value=None) # type:ignore
Expand Down
28 changes: 14 additions & 14 deletions beautify/beautify.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ async def com_beautify(self, ctx: commands.Context, *, data: Optional[str]):
This command accepts it in a few forms.
1. Upload the JSON as a file (it can be .txt or .json)
​ ​ ​ ​ - Note that if you upload multiple files I will only scan the first one
- Note that if you upload multiple files I will only scan the first one
2. Paste the JSON in the command
​ ​ ​ ​ - You send it raw, in inline code or a codeblock
3. Reply to a message with JSON
​ ​ ​ ​ - I will search for attachments and any codeblocks in the message
- You can send it raw, in inline code or a codeblock
3. Reply to a message with JSON
- I will search for attachments and any codeblocks in the message
**Examples:**
- `[p]beautify {"1": "One", "2": "Two"}`
- `[p]beautify` (with file uploaded)
- `[p]beautify` (while replying to a messsage)
- `[p]beautify {"1": "One", "2": "Two"}`
- `[p]beautify` (with file uploaded)
- `[p]beautify` (while replying to a messsage)
"""
try:
raw_json = await get_data(ctx, data)
Expand All @@ -105,16 +105,16 @@ async def com_minify(self, ctx: commands.Context, *, data: Optional[str]):
This command accepts it in a few forms.
1. Upload the JSON as a file (it can be .txt or .json)
​ ​ ​ ​ - Note that if you upload multiple files I will only scan the first one
- Note that if you upload multiple files I will only scan the first one
2. Paste the JSON in the command
​ ​ ​ ​ - You send it raw, in inline code or a codeblock
3. Reply to a message with JSON
​ ​ ​ ​ - I will search for attachments and any codeblocks in the message
- You can send it raw, in inline code or a codeblock
3. Reply to a message with JSON
- I will search for attachments and any codeblocks in the message
**Examples:**
- `[p]minify {"1": "One", "2": "Two"}`
- `[p]minify` (with file uploaded)
- `[p]minify` (while replying to a messsage)
- `[p]minify {"1": "One", "2": "Two"}`
- `[p]minify` (with file uploaded)
- `[p]minify` (while replying to a messsage)
"""
try:
raw_json = await get_data(ctx, data)
Expand Down
18 changes: 9 additions & 9 deletions betteruptime/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ async def uptime_command(self, ctx: commands.Context, num_days: int = 30):
Note: embeds must be enabled for this rich data to show
**Examples:**
- `[p]uptime`
- `[p]uptime 0` (for all-time data)
- `[p]uptime 7`
- `[p]uptime`
- `[p]uptime 0` (for all-time data)
- `[p]uptime 7`
"""
# MOSTLY FROM CORE'S UPTIME COMMAND
since = datetime_to_timestamp(self.bot.uptime.replace(tzinfo=datetime.timezone.utc))
Expand Down Expand Up @@ -100,9 +100,9 @@ async def downtime(self, ctx: commands.Context, num_days: int = 30):
Otherwise, it needs to be `5` or more.
**Examples:**
- `[p]uptime`
- `[p]uptime 0` (for all-time data)
- `[p]uptime 7`
- `[p]uptime`
- `[p]uptime 0` (for all-time data)
- `[p]uptime 7`
"""
if self.ready.is_set() is False:
async with ctx.typing():
Expand Down Expand Up @@ -150,9 +150,9 @@ async def uptimegraph(self, ctx: commands.Context, num_days: int = 30):
Otherwise, it needs to be `5` or more.
**Examples:**
- `[p]uptime` - for the default of 30 days
- `[p]uptime 0` - for all-time data
- `[p]uptime 7` - 7 days
- `[p]uptime` - for the default of 30 days
- `[p]uptime 0` - for all-time data
-]uptime 7` - 7 days
"""
if num_days == 0:
num_days = 9999 # this works, trust me
Expand Down
54 changes: 27 additions & 27 deletions birthday/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ async def set(self, ctx: commands.Context, *, birthday: BirthdayConverter):
If you use a date in the format xx/xx/xx or xx-xx-xx MM-DD-YYYY is assumed.
**Examples:**
- `[p]bday set 24th September`
- `[p]bday set 24th Sept 2002`
- `[p]bday set 9/24/2002`
- `[p]bday set 9-24-2002`
- `[p]bday set 9-24`
- `[p]bday set 24th September`
- `[p]bday set 24th Sept 2002`
- `[p]bday set 9/24/2002`
- `[p]bday set 9-24-2002`
- `[p]bday set 9-24`
"""
# guild only check in group
if TYPE_CHECKING:
Expand Down Expand Up @@ -118,8 +118,8 @@ async def upcoming(self, ctx: commands.Context, days: int = 7):
"""View upcoming birthdays, defaults to 7 days.
**Examples:**
- `[p]birthday upcoming` - default of 7 days
- `[p]birthday upcoming 14` - 14 days
- `[p]birthday upcoming` - default of 7 days
- `[p]birthday upcoming 14` - 14 days
"""
# guild only check in group
if TYPE_CHECKING:
Expand Down Expand Up @@ -516,9 +516,9 @@ async def time(self, ctx: commands.Context, *, time: TimeConverter):
Minutes are ignored.
**Examples:**
- `[p]bdset time 7:00` - set the time to 7:45AM UTC
- `[p]bdset time 12AM` - set the time to midnight UTC
- `[p]bdset time 3PM` - set the time to 3:00PM UTC
- `[p]bdset time 7:00` - set the time to 7:45AM UTC
- `[p]bdset time 12AM` - set the time to midnight UTC
- `[p]bdset time 3PM` - set the time to 3:00PM UTC
"""
# group has guild check
if TYPE_CHECKING:
Expand Down Expand Up @@ -560,14 +560,14 @@ async def msgwithoutyear(self, ctx: commands.Context, *, message: str):
If you would like to mention a role, you will need to run `[p]bdset rolemention true`.
**Placeholders:**
- `{name}` - the user's name
- `{mention}` - an @ mention of the user
- `{name}` - the user's name
- `{mention}` - an @ mention of the user
All the placeholders are optional.
**Examples:**
- `[p]bdset msgwithoutyear Happy birthday {mention}!`
- `[p]bdset msgwithoutyear {mention}'s birthday is today! Happy birthday {name}.`
- `[p]bdset msgwithoutyear Happy birthday {mention}!`
- `[p]bdset msgwithoutyear {mention}'s birthday is today! Happy birthday {name}.`
"""
# group has guild check
if TYPE_CHECKING:
Expand Down Expand Up @@ -608,15 +608,15 @@ async def msgwithyear(self, ctx: commands.Context, *, message: str):
If you would like to mention a role, you will need to run `[p]bdset rolemention true`
**Placeholders:**
- `{name}` - the user's name
- `{mention}` - an @ mention of the user
- `{new_age}` - the user's new age
- `{name}` - the user's name
- `{mention}` - an @ mention of the user
- `{new_age}` - the user's new age
All the placeholders are optional.
**Examples:**
- `[p]bdset msgwithyear {mention} has turned {new_age}, happy birthday!`
- `[p]bdset msgwithyear {name} is {new_age} today! Happy birthday {mention}!`
- `[p]bdset msgwithyear {mention} has turned {new_age}, happy birthday!`
- `[p]bdset msgwithyear {name} is {new_age} today! Happy birthday {mention}!`
"""
# group has guild check
if TYPE_CHECKING:
Expand Down Expand Up @@ -655,7 +655,7 @@ async def channel(self, ctx: commands.Context, channel: discord.TextChannel):
Set the channel where the birthday message will be sent.
**Example:**
- `[p]bdset channel #birthdays` - set the channel to #birthdays
- `[p]bdset channel #birthdays` - set the channel to #birthdays
"""
# group has guild check
if TYPE_CHECKING:
Expand Down Expand Up @@ -686,9 +686,9 @@ async def role(self, ctx: commands.Context, *, role: discord.Role):
You can give the exact name or a mention.
**Example:**
- `[p]bdset role @Birthday` - set the role to @Birthday
- `[p]bdset role Birthday` - set the role to @Birthday without a mention
- `[p]bdset role 418058139913063657` - set the role with an ID
- `[p]bdset role @Birthday` - set the role to @Birthday
- `[p]bdset role Birthday` - set the role to @Birthday without a mention
- `[p]bdset role 418058139913063657` - set the role with an ID
"""
# group has guild check
if TYPE_CHECKING:
Expand Down Expand Up @@ -719,11 +719,11 @@ async def force(
spaces, make sure to put quotes around it (`"`).
**Examples:**
- `[p]bdset set @User 1-1-2000` - set the birthday of `@User` to 1/1/2000
- `[p]bdset set User 1/1` - set the birthday of `@User` to 1/1/2000
- `[p]bdset set "User with spaces" 1-1` - set the birthday of `@User with spaces`
- `[p]bdset set @User 1-1-2000` - set the birthday of `@User` to 1/1/2000
- `[p]bdset set User 1/1` - set the birthday of `@User` to 1/1/2000
- `[p]bdset set "User with spaces" 1-1` - set the birthday of `@User with spaces`
to 1/1
- `[p]bdset set 354125157387344896 1/1/2000` - set the birthday of `@User` to 1/1/2000
-]bdset set 354125157387344896 1/1/2000` - set the birthday of `@User` to 1/1/2000
"""
if birthday.year != 1 and birthday.year < MIN_BDAY_YEAR:
await ctx.send(f"I'm sorry, but I can't set a birthday to before {MIN_BDAY_YEAR}.")
Expand Down
11 changes: 11 additions & 0 deletions buttonpoll/buttonpoll.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ async def async_init(self) -> None:
@commands.bot_has_permissions(embed_links=True)
@commands.command(name="buttonpoll", aliases=["bpoll"], usage="[chan]")
async def buttonpoll(self, ctx: commands.Context, chan: Optional[TextChannel] = None):
"""
Start a button-based poll
This is an interactive setup. By default the current channel will be used,
but if you want to start a poll remotely you can send the channel name
along with the buttonpoll command.
**Examples:**
- `[p]buttonpoll` - start a poll in the current channel
- `[p]buttonpoll #polls` start a poll somewhere else
"""
channel = chan or ctx.channel
if TYPE_CHECKING:
assert isinstance(channel, (TextChannel, discord.Thread))
Expand Down
2 changes: 1 addition & 1 deletion calc/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def calcinfo(self, ctx: commands.Context):
@commands.command()
async def calc(self, ctx: commands.Context):
"""
Show an interactive calculator using buttons.
Start an interactive calculator using buttons.
"""
view = CalcView(self.bot, ctx.author.id)
embed = await view.build_embed(await ctx.embed_colour())
Expand Down
14 changes: 7 additions & 7 deletions cmdlog/cmdlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ async def channel(self, ctx: commands.Context, channel: Optional[TextChannel]):
Run the comand without a channel to stop sending.
**Example:**
- `[p]cmdlog channel #com-log` - set the log channel to #com-log
- `[p]cmdlog channel` - stop sending logs
- `[p]cmdlog channel #com-log` - set the log channel to #com-log
- `[p]cmdlog channel` - stop sending logs
"""
# guild only check
if TYPE_CHECKING:
Expand Down Expand Up @@ -320,7 +320,7 @@ async def user(self, ctx: commands.Context, user_id: int):
Upload all the logs that are stored for a specific User ID in the cache.
**Example:**
- `[p]cmdlog user 418078199982063626`
- `[p]cmdlog user 418078199982063626`
"""
now = datetime.datetime.now().strftime(TIME_FORMAT)
logs = [f"[{i.time}] {i}" for i in self.log_cache if i.user.id == user_id]
Expand Down Expand Up @@ -356,7 +356,7 @@ async def server(self, ctx: commands.Context, server_id: int):
Upload all the logs that are stored for for a specific server ID in the cache.
**Example:**
- `[p]cmdlog server 527961662716772392`
- `[p]cmdlog server 527961662716772392`
"""
now = datetime.datetime.now().strftime(TIME_FORMAT)
logs = [f"[{i.time}] {i}" for i in self.log_cache if i.guild and i.guild.id == server_id]
Expand Down Expand Up @@ -398,9 +398,9 @@ async def command(self, ctx: commands.Context, *, command: str):
As arguments are not stored, you cannot search for them.
**Examples:**
- `[p]cmdlog command ping`
- `[p]cmdlog command playlist`
- `[p]cmdlog command playlist create`
- `[p]cmdlog command ping`
- `[p]cmdlog command playlist`
- `[p]cmdlog command playlist create`
"""
# not checking if a command exists because want to allow for this to find it if it was
# unloaded (eg if com was found to be intensive, see if it was one user spamming it)
Expand Down
18 changes: 9 additions & 9 deletions covidgraph/covidgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ async def cases(self, ctx: commands.Context, days: Optional[int], *, country: st
`country` can also be `world` to get the worldwide data.
**Examples:**
- `[p]covidgraph cases US` - All time data for the US
- `[p]covidgraph cases 7 US` - Last 7 days for the US
- `[p]covidgraph cases world` - Worldwide data
- `[p]covidgraph cases US` - All time data for the US
- `[p]covidgraph cases 7 US` - Last 7 days for the US
- `[p]covidgraph cases world` - Worldwide data
"""
if days and days < 7:
await ctx.send("`days` must be at least 7.")
Expand Down Expand Up @@ -92,9 +92,9 @@ async def deaths(self, ctx: commands.Context, days: Optional[int], *, country: s
`country` can also be `world` to get the worldwide data.
**Examples:**
- `[p]covidgraph deaths US` - All time data for the US
- `[p]covidgraph deaths 7 US` - Last 7 days for the US
- `[p]covidgraph deaths world` - Worldwide data
- `[p]covidgraph deaths US` - All time data for the US
- `[p]covidgraph deaths 7 US` - Last 7 days for the US
- `[p]covidgraph deaths world` - Worldwide data
"""
if days and days < 7:
await ctx.send("`days` must be at least 7.")
Expand Down Expand Up @@ -128,9 +128,9 @@ async def vaccines(self, ctx: commands.Context, days: Optional[int], *, country:
`country` can also be `world` to get the worldwide data.
**Examples:**
- `[p]covidgraph vaccines US` - All time data for the US
- `[p]covidgraph vaccines 7 US` - Last 7 days for the US
- `[p]covidgraph vaccines world` - Worldwide data
- `[p]covidgraph vaccines US` - All time data for the US
- `[p]covidgraph vaccines 7 US` - Last 7 days for the US
- `[p]covidgraph vaccines world` - Worldwide data
"""
if days and days < 7:
await ctx.send("`days` must be at least 7.")
Expand Down
2 changes: 1 addition & 1 deletion fivemstatus/fivemstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def setup(self, ctx: commands.Context, channel: discord.TextChannel, serve
"""Set up a FiveM status message.
**Examples:**
- `[p]fivemstatus setup #status 1.0.1.0:30120`
- `[p]fivemstatus setup #status 1.0.1.0:30120`
"""
try:
data = await self.get_data(server)
Expand Down
6 changes: 3 additions & 3 deletions ghissues/ghissues.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ async def ghi(self, ctx: commands.Context, issue: int):
To open the interactive issue view, run `[p]ghi <issue_num>`.
**Examples:**
- `[p]ghi 11`
- `[p]ghi howtoken`
- `[p]ghi newissue`
- `[p]ghi 11`
- `[p]ghi howtoken`
- `[p]ghi newissue`
"""
if self.setup is False:
return await ctx.send(
Expand Down
Loading

0 comments on commit b5aedfa

Please sign in to comment.