mirror of
https://github.com/miaowware/qrm2.git
synced 2025-07-30 11:52:26 -04:00
Merge pull request #35 from classabbyamp/bare-excepts
fixed bare excepts
This commit is contained in:
commit
baede1099a
@ -30,7 +30,7 @@ class MorseCog(commands.Cog):
|
|||||||
for char in msg.upper():
|
for char in msg.upper():
|
||||||
try:
|
try:
|
||||||
result += self.ascii2morse[char]
|
result += self.ascii2morse[char]
|
||||||
except:
|
except KeyError:
|
||||||
result += '<?>'
|
result += '<?>'
|
||||||
result += ' '
|
result += ' '
|
||||||
embed = discord.Embed(title=f'Morse Code for {msg}',
|
embed = discord.Embed(title=f'Morse Code for {msg}',
|
||||||
@ -53,7 +53,7 @@ class MorseCog(commands.Cog):
|
|||||||
for char in word:
|
for char in word:
|
||||||
try:
|
try:
|
||||||
result += self.morse2ascii[char]
|
result += self.morse2ascii[char]
|
||||||
except:
|
except KeyError:
|
||||||
result += '<?>'
|
result += '<?>'
|
||||||
result += ' '
|
result += ' '
|
||||||
embed = discord.Embed(title=f'ASCII for {msg0}',
|
embed = discord.Embed(title=f'ASCII for {msg0}',
|
||||||
@ -74,7 +74,7 @@ class MorseCog(commands.Cog):
|
|||||||
try:
|
try:
|
||||||
cwChar = self.ascii2morse[char].replace('-', '==')
|
cwChar = self.ascii2morse[char].replace('-', '==')
|
||||||
weight += len(cwChar) * 2 + 2
|
weight += len(cwChar) * 2 + 2
|
||||||
except:
|
except KeyError:
|
||||||
res = f'Unknown character {char} in callsign'
|
res = f'Unknown character {char} in callsign'
|
||||||
await ctx.send(res)
|
await ctx.send(res)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user