Skip to content

Commit 94341f5

Browse files
committed
updated get_lang
1 parent 3103a91 commit 94341f5

File tree

5 files changed

+221
-52
lines changed

5 files changed

+221
-52
lines changed

src/exts/essentials.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, bot, cfg_chan_id):
4242

4343
async def run(self, ctx):
4444
# welcome & goodbye messages
45-
tr = Translator(name, get_lang(ctx))
45+
tr = Translator(name, get_lang(ctx.guild.id))
4646
msgs = {
4747
"welcome": [tr["welcome1"], tr["welcome2"]],
4848
"goodbye": [tr["goodbye1"], tr["goodbye2"]],
@@ -146,7 +146,7 @@ async def on_member_remove(self, member):
146146
@commands.command()
147147
async def ping(self, ctx):
148148
"""This command responds with the current latency."""
149-
tr = Translator(name, get_lang(ctx))
149+
tr = Translator(name, get_lang(ctx.guild.id))
150150
latency = self.bot.latency
151151
await ctx.send(EMOJIS["ping_pong"] + tr["latency"].format(latency))
152152

@@ -237,7 +237,7 @@ async def clear(self, ctx, *filters):
237237
@commands.command()
238238
async def status(self, ctx):
239239
"""returns some statistics about the server and their members"""
240-
tr = Translator(name, get_lang(ctx))
240+
tr = Translator(name, get_lang(ctx.guild.id))
241241
stats = discord.Embed(
242242
name=tr["stats_name"],
243243
description=tr["stats_description"].format(

src/exts/poll.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, bot, cfg_chan_id):
3737

3838
async def run(self, ctx):
3939
try:
40-
tr = Translator(name, get_lang(ctx))
40+
tr = Translator(name, get_lang(ctx.guild.id))
4141
await self.config_channel.send(tr["start_conf"])
4242
pursue = await self.get_yn(ctx, tr["pursue"])
4343
if not pursue:

src/exts/role.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, bot, config_chan_id):
3434
super().__init__(bot, config_chan_id)
3535

3636
async def run(self, ctx):
37-
tr = Translator(name, get_lang(ctx))
37+
tr = Translator(name, get_lang(ctx.guild.id))
3838
try:
3939
await ctx.send(tr["start_conf"])
4040
free_roles = []
@@ -88,7 +88,7 @@ async def role(self, ctx):
8888
@role.command()
8989
async def add(self, ctx, member: discord.Member, *roles: discord.Role):
9090
"""Gives <member> listed <roles> roles"""
91-
tr = Translator(name, get_lang(ctx))
91+
tr = Translator(name, get_lang(ctx.guild.id))
9292
# checking if member can self-assing role(s)
9393
if not has_auth("admin")(ctx):
9494
allowed_roles = []

0 commit comments

Comments
 (0)