Skip to content

Commit

Permalink
Fix f-string syntax errors (#69)
Browse files Browse the repository at this point in the history
F-strings don't like other strings within their formatting ex: ```string_a = f"Result: {f(1)}"``` = Ok, ```string_b = f"Result: {g("1")}"``` = Syntaxerror
  • Loading branch information
Edwinexd authored Mar 17, 2021
1 parent dc11b08 commit 103f7e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,15 +1219,17 @@ async def set_systemchannel(ctx):
if server_channel:
server_channel = server_channel[0][0]

main_text = (await getchannel(system_channel)).mention if system_channel else 'none'
server_text = (await getchannel(server_channel)).mention if server_channel else 'none'
await ctx.send(
"Define if you are setting up a server or main system channel and"
f" mention the target channel.\n```\n{prefix}systemchannel"
" <main/server> #channelname\n```\nThe server system channel"
" reports errors and notifications related to this server only,"
" while the main system channel is used as a fall-back and for"
" bot-wide errors and notifications.\n\nThe current channels are:\n"
f"**Main:** {(await getchannel(system_channel)).mention if system_channel else 'none'}\n"
f"**Server:** {(await getchannel(server_channel)).mention if server_channel else 'none'}"
f"**Main:** {main_text}\n"
f"**Server:** {server_text}"
)
return

Expand Down

0 comments on commit 103f7e2

Please sign in to comment.