Skip to content

Commit

Permalink
updated get_lang
Browse files Browse the repository at this point in the history
  • Loading branch information
s0lst1ce committed May 12, 2020
1 parent 3103a91 commit 94341f5
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 52 deletions.
6 changes: 3 additions & 3 deletions src/exts/essentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, bot, cfg_chan_id):

async def run(self, ctx):
# welcome & goodbye messages
tr = Translator(name, get_lang(ctx))
tr = Translator(name, get_lang(ctx.guild.id))
msgs = {
"welcome": [tr["welcome1"], tr["welcome2"]],
"goodbye": [tr["goodbye1"], tr["goodbye2"]],
Expand Down Expand Up @@ -146,7 +146,7 @@ async def on_member_remove(self, member):
@commands.command()
async def ping(self, ctx):
"""This command responds with the current latency."""
tr = Translator(name, get_lang(ctx))
tr = Translator(name, get_lang(ctx.guild.id))
latency = self.bot.latency
await ctx.send(EMOJIS["ping_pong"] + tr["latency"].format(latency))

Expand Down Expand Up @@ -237,7 +237,7 @@ async def clear(self, ctx, *filters):
@commands.command()
async def status(self, ctx):
"""returns some statistics about the server and their members"""
tr = Translator(name, get_lang(ctx))
tr = Translator(name, get_lang(ctx.guild.id))
stats = discord.Embed(
name=tr["stats_name"],
description=tr["stats_description"].format(
Expand Down
2 changes: 1 addition & 1 deletion src/exts/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, bot, cfg_chan_id):

async def run(self, ctx):
try:
tr = Translator(name, get_lang(ctx))
tr = Translator(name, get_lang(ctx.guild.id))
await self.config_channel.send(tr["start_conf"])
pursue = await self.get_yn(ctx, tr["pursue"])
if not pursue:
Expand Down
4 changes: 2 additions & 2 deletions src/exts/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, bot, config_chan_id):
super().__init__(bot, config_chan_id)

async def run(self, ctx):
tr = Translator(name, get_lang(ctx))
tr = Translator(name, get_lang(ctx.guild.id))
try:
await ctx.send(tr["start_conf"])
free_roles = []
Expand Down Expand Up @@ -88,7 +88,7 @@ async def role(self, ctx):
@role.command()
async def add(self, ctx, member: discord.Member, *roles: discord.Role):
"""Gives <member> listed <roles> roles"""
tr = Translator(name, get_lang(ctx))
tr = Translator(name, get_lang(ctx.guild.id))
# checking if member can self-assing role(s)
if not has_auth("admin")(ctx):
allowed_roles = []
Expand Down
Loading

0 comments on commit 94341f5

Please sign in to comment.