Skip to content

Commit fa2e7a8

Browse files
committed
Alvorada 1.3.0
1 parent f380f39 commit fa2e7a8

File tree

13 files changed

+256
-15
lines changed

13 files changed

+256
-15
lines changed

changelog

+8
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@
1717
* 6.2.1:
1818
* Added permission check for voice channels on the /play command.
1919
* Modified way of fetching player.
20+
21+
* 6.3.0:
22+
* Added user count check for voice channels on the /play command.
23+
* Fixed a problem where the bot would hang and not respond when given a private/deleted track/playlist link.
24+
* Fixed a proglem where the bot would hand and not respond when no search results for a song query where found.
25+
* The skip command now adds the skipped tracks to the player's history, so you can go back to them if you wish.
26+
* Valorant daily shop now correctly pings the user.
27+
* Finished Kobold integration.

init.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
RinBot v6.2.1 'Alvorada'
2+
RinBot v6.3.0 'Alvorada'
33
development started on 11/06/2024
44
made by rin (https://github.com/kmrin, km.rin on https://discord.gg)
55
"""

rinbot/config/client/rin.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"VERSION": "v6.2.1 'Alvorada' (STABLE)",
2+
"VERSION": "v6.3.0 'Alvorada' (STABLE)",
33
"STATUS_LANG": "en-GB",
44
"LOG_STATUS_CHANGE": false,
55
"PREFIX": "!",
@@ -23,7 +23,7 @@
2323

2424
"FORTNITE_DAILY_SHOP_ENABLED": false,
2525
"FORTNITE_DAILY_SHOP_UPDATE_TIME": "00:00:10",
26-
"FORTNITE_DAILY_SHOP_LANG": "en",
26+
"FORTNITE_DAILY_SHOP_LANG": "en-US",
2727
"FORTNITE_KEY": null,
2828

2929
"VALORANT_DAILY_SHOP_ENABLED": false,

rinbot/config/localization/en-GB.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,10 @@
436436
"MUSIC_INVALID_URL": " ❌ The URL provided is invalid.",
437437
"MUSIC_LINK_IS_PLAYLIST": " ❌ The URL provided is for a playlist, not a individual track.",
438438
"MUSIC_LINK_IS_NOT_PLAYLIST": " ❌ The URL provided is not a playlist URL.",
439-
"MUSIC_NO_RESULTS_FROM_URL": " ❌ Couldn't get any data from the provided URL.",
439+
"MUSIC_NO_RESULTS_FROM_URL": " ❌ Couldn't get any data from the provided URL.\nThe track or playlist could've been privated or deleted.",
440440
"MUSIC_FAV_CHOOSE": " ⭐ Pick a favourite",
441+
"MUSIC_CHANNEL_FULL": " ❌ The music channel is full, I can't join you!",
442+
"MUSIC_SEARCH_NO_RESULTS": " ❌ No results for `{search}`",
441443

442444
"BOORU_ROOT_NAME": "booru",
443445
"BOORU_ROOT_DESC": "Danbooru commands",
@@ -481,7 +483,7 @@
481483

482484
"VALORANT_PROVIDE_BOTH": " ❌ Please provide both a username and password.",
483485
"VALORANT_NO_LOGIN": " ❌ No login for this user",
484-
"VALORANT_USER_STORE": "**{player}'s daily shop!**\nExpires in: `{time}`",
486+
"VALORANT_USER_STORE": "**{player}'s** daily shop!\nExpires in: `{time}`",
485487
"VALORANT_NAME": "valorant",
486488
"VALORANT_DESC": "Valorant commands",
487489
"VALORANT_LOGIN_NAME": "login",
@@ -514,6 +516,8 @@
514516
"VALORANT_CONFIG_GUILD_MISCONFIG_NO_CHANNEL": " ❌ Couldn't fetch the daily shop channel from this server, it probably got deleted. Use the DMs option.",
515517
"VALORANT_CONFIG_SET": " ✅ Valorant daily shop settings updated!",
516518
"VALORANT_DS_PRIVATE": " ⚠️ You are receiving this in your DMs because the server you configured disabled the functionality.",
519+
"VALORANT_DS_CHANNEL": " ✌️ Hey, {player}!",
520+
"VALORANT_LOGIN_2FA_NOT_SUPPORTED": " ❌ Sorry, but at the moment 2FA is not supported due to development issues.\nPlease wait for a future version of RinBot.",
517521

518522
"": ""
519523
}

rinbot/config/localization/pt-BR.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,10 @@
439439
"MUSIC_INVALID_URL": " ❌ Link inválido.",
440440
"MUSIC_LINK_IS_PLAYLIST": " ❌ Esse link é para uma playlist, não uma música individual.",
441441
"MUSIC_LINK_IS_NOT_PLAYLIST": " ❌ Esse link não é de uma playlist.",
442-
"MUSIC_NO_RESULTS_FROM_URL": " ❌ Não consegui extrair nenhuma informação desse link.",
442+
"MUSIC_NO_RESULTS_FROM_URL": " ❌ Não consegui extrair nenhuma informação deste link.\nA música ou playlist pode estar privada ou ter sido excluída.",
443443
"MUSIC_FAV_CHOOSE": " ⭐ Escolha um favorito",
444+
"MUSIC_CHANNEL_FULL": " ❌ O canal está cheio, não consigo entrar!",
445+
"MUSIC_SEARCH_NO_RESULTS": " ❌ Nenhum resultado para `{search}`",
444446

445447
"BOORU_ROOT_NAME": "booru",
446448
"BOORU_ROOT_DESC": "Comandos do danbooru",
@@ -484,7 +486,7 @@
484486

485487
"VALORANT_PROVIDE_BOTH": " ❌ Porfavor providencie tanto um nome de usuário quanto uma senha.",
486488
"VALORANT_NO_LOGIN": " ❌ Nenhum login salvo para este usuário",
487-
"VALORANT_USER_STORE": "**Loja diária de {player}!**\nExpira em: `{time}`",
489+
"VALORANT_USER_STORE": "Loja diária de **{player}**!\nExpira em: `{time}`",
488490
"VALORANT_NAME": "valorant",
489491
"VALORANT_DESC": "Comandos do vava",
490492
"VALORANT_LOGIN_NAME": "login",
@@ -517,6 +519,8 @@
517519
"VALORANT_CONFIG_GUILD_MISCONFIG_NO_CHANNEL": " ❌ Não consegui verificar o canal de texto de lojas diárias deste servidor, ele provavelmente foi deletado. Use a opção de direct.",
518520
"VALORANT_CONFIG_SET": " ✅ Configurações da loja diária do Valorant atualizadas!",
519521
"VALORANT_DS_PRIVATE": " ⚠️ Você recebeu este direct pois o servidor onde você configurou a loja diária do Valorant desligou a funcionalidade.",
522+
"VALORANT_DS_CHANNEL": " ✌️ Opa, {player}!",
523+
"VALORANT_LOGIN_2FA_NOT_SUPPORTED": " ❌ Desculpe, mas no momento a RinBot não consegue fazer login em contas que possuem 2FA ativo devido a problemas de desenvolvimento.\nAguarde uma futura versão da RinBot ter o problema corrigido.",
520524

521525
"": ""
522526
}

rinbot/core/interface.py

+4
Original file line numberDiff line numberDiff line change
@@ -801,9 +801,13 @@ async def callback_select_skip(self, interaction: Interaction) -> None:
801801
index = int(self.select.values[0])
802802
selected_track = self.queue_parts[self.current_page][index]
803803
to_remove = self.player.queue[:self.player.queue.index(selected_track)]
804+
to_remove.reverse()
804805

805806
for track in to_remove:
806807
self.player.queue.remove(track)
808+
self.player.history.insert(-1, track)
809+
810+
self.player.performed_skip = True
807811

808812
await self.player.skip(force=True)
809813

rinbot/core/loggers.py

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def format(self, record):
7070

7171
class Loggers:
7272
ROOT: logging.Logger = root_logger
73+
AI: logging.Logger = logging.getLogger('AI')
7374
COMMAND_CHECKS: logging.Logger = logging.getLogger('Command Checks')
7475
CLIENT: logging.Logger = logging.getLogger('Client')
7576
COMMANDS: logging.Logger = logging.getLogger('Commands')

rinbot/core/tasks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ async def start(self) -> None:
3636
@tasks.loop(minutes=int(conf['STATUS_CHANGE_INTERVAL']))
3737
async def _status_loop(self) -> None:
3838
def _get_lang() -> None:
39-
txt = read(get_os_path(f'{Path.locale}/en-GB.json'))
39+
txt = read(get_os_path(f'{Path.locale}/en-GB.json'), silent=True)
4040
if not txt:
4141
logger.error('huh? what?')
4242

4343
status_lang = conf['STATUS_LANG']
44-
txt = read(get_os_path(f'{Path.locale}/{status_lang}.json'))
44+
txt = read(get_os_path(f'{Path.locale}/{status_lang}.json'), silent=True)
4545
if not txt:
4646
_get_lang()
4747

rinbot/extensions/music.py

+29-4
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ async def on_wavelink_track_end(self, payload: nextlink.TrackEndEventPayload) ->
119119
await player.last_message.edit(embed=new_embed, view=None)
120120

121121
if not player.from_previous_interaction:
122-
player.history.append(payload.track)
122+
if player.performed_skip:
123+
player.history.insert(0, payload.track)
124+
player.performed_skip = False
125+
else:
126+
player.history.append(payload.track)
123127

124128
player.from_previous_interaction = False
125129

@@ -236,6 +240,18 @@ async def _play(
236240
resp_type=ResponseType.FOLLOWUP
237241
)
238242

243+
# Make sure there is space for me in there
244+
if voice_channel.user_limit != 0:
245+
if len(voice_channel.members) >= voice_channel.user_limit:
246+
return await respond(
247+
interaction, Colour.red(),
248+
get_localized_string(
249+
locale, 'MUSIC_CHANNEL_FULL'
250+
),
251+
hidden=True,
252+
resp_type=ResponseType.FOLLOWUP
253+
)
254+
239255
""" # Get player
240256
if guild_id in self.bot.music_clients:
241257
player = self.bot.music_clients[guild_id]
@@ -281,8 +297,17 @@ async def _play(
281297
)
282298

283299
else:
284-
if results:
285-
playables.append(results[0])
300+
if not results:
301+
return await respond(
302+
interaction, Colour.red(),
303+
get_localized_string(
304+
locale, 'MUSIC_NO_RESULTS_FROM_URL'
305+
),
306+
hidden=True,
307+
resp_type=ResponseType.FOLLOWUP
308+
)
309+
310+
playables.append(results[0])
286311

287312
# If it's a search query
288313
else:
@@ -325,7 +350,7 @@ async def _play(
325350
colour=Colour.yellow()
326351
)
327352

328-
return await interaction.edit_original_message(embed=embed, view=None)
353+
return await interaction.edit_original_message(content=None, embed=embed, view=None)
329354

330355

331356
for result in view.user_choices:

rinbot/extensions/valorant.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def __embed(skin: Dict) -> Embed:
7777
def __get_store_embeds(cls, player: str, offer: Dict, locale: str) -> List[Embed]:
7878
data = GetFormat.offer_format(offer, locale)
7979

80+
player = player.split('#')[0]
8081
duration = data.pop('duration')
8182
expires = get_expiration_time(datetime.now(UTC) + timedelta(seconds=duration), locale)
8283
description = get_localized_string(
@@ -177,15 +178,24 @@ async def _valorant_login(
177178
)
178179

179180
elif authenticate['auth'] == '2fa':
180-
cookies = authenticate['cookie']
181+
""" cookies = authenticate['cookie']
181182
message = authenticate['message']
182183
label = authenticate['label']
183184
184185
modal = Valorant2FAView(
185186
interaction, locale, self.bot.val_db, cookies, message, label
186187
)
187188
188-
await interaction.response.send_modal(modal)
189+
await interaction.response.send_modal(modal) """
190+
191+
await respond(
192+
interaction, Colour.red(),
193+
get_localized_string(
194+
locale, 'VALORANT_LOGIN_2FA_NOT_SUPPORTED'
195+
),
196+
hidden=True,
197+
resp_type=ResponseType.FOLLOWUP
198+
)
189199

190200
# /valorant logout
191201
@_valorant.subcommand(

0 commit comments

Comments
 (0)