mirror of
https://github.com/Floriansylvain/Risitas_BOT.git
synced 2026-08-19 11:43:16 +02:00
✏️ - Renamed args name in commands functions so the $help command make sense.
This commit is contained in:
+4
-4
@@ -12,12 +12,12 @@ class LolCmds(commands.Cog):
|
||||
|
||||
@commands.command()
|
||||
@commands.cooldown(1, 2, commands.BucketType.user)
|
||||
async def lol_rank(self, ctx, arg, argf=None):
|
||||
if argf is None:
|
||||
player = what_player(arg)
|
||||
async def lol_rank(self, ctx, invocator_name, x=None):
|
||||
if x is None:
|
||||
player = what_player(invocator_name)
|
||||
if player != 0:
|
||||
ranks = rank_track(player)
|
||||
embed = discord.Embed(title=arg, url='https://bit.ly/3biTekM')
|
||||
embed = discord.Embed(title=invocator_name, url='https://bit.ly/3biTekM')
|
||||
embed.set_thumbnail(url='http://ddragon.leagueoflegends.com/cdn/11.2.1/img/profileicon/' + str(
|
||||
player['profileIconId']) + '.png')
|
||||
embed.set_author(name='League Of Legend - Rank', url='https://euw.leagueoflegends.com/en-gb/',
|
||||
|
||||
+11
-11
@@ -9,13 +9,13 @@ class OsuCmds(commands.Cog):
|
||||
self.bot = bot
|
||||
|
||||
@commands.command()
|
||||
async def osu_profile(self, ctx, arg, argF=None):
|
||||
if argF is None:
|
||||
lst = await ask_osu_profile(arg)
|
||||
async def osu_profile(self, ctx, username, x=None):
|
||||
if x is None:
|
||||
lst = await ask_osu_profile(username)
|
||||
if lst == 1:
|
||||
await ctx.send('The username you entered is unknown.')
|
||||
else:
|
||||
embed = discord.Embed(title=arg, url='https://osu.ppy.sh/users/' + str(lst[0]))
|
||||
embed = discord.Embed(title=username, url='https://osu.ppy.sh/users/' + str(lst[0]))
|
||||
embed.set_author(name='Osu! - Profile', url='https://osu.ppy.sh/home',
|
||||
icon_url=r'https://upload.wikimedia.org/wikipedia/commons/4/44/Osu%21Logo_%282019%29.png')
|
||||
embed.set_thumbnail(url='https://a.ppy.sh/' + str(lst[0]))
|
||||
@@ -37,9 +37,9 @@ class OsuCmds(commands.Cog):
|
||||
|
||||
|
||||
@commands.command()
|
||||
async def osu_lastgame(self, ctx, arg, argF=None):
|
||||
if argF is None:
|
||||
lst = await ask_osu_last_game(arg)
|
||||
async def osu_lastgame(self, ctx, username, x=None):
|
||||
if x is None:
|
||||
lst = await ask_osu_last_game(username)
|
||||
if lst == 1:
|
||||
await ctx.send('The player you entered is unknown or didn\'t played any game recently.')
|
||||
else:
|
||||
@@ -59,7 +59,7 @@ class OsuCmds(commands.Cog):
|
||||
value=str("%.2f" % (((lst[12]*300)+(lst[13]*100)+(lst[14]*50))/(sum(lst[12:16])*300)*100) + '%'))
|
||||
embed.add_field(name='100', value=str(lst[13]))
|
||||
embed.add_field(name='Katu', value=str(lst[16]))
|
||||
embed.add_field(name='Player :', value=str(arg))
|
||||
embed.add_field(name='Player :', value=str(username))
|
||||
embed.add_field(name='50', value=str(lst[14]))
|
||||
embed.add_field(name='Miss', value=str(lst[15]))
|
||||
embed.add_field(name='|', value='|')
|
||||
@@ -69,9 +69,9 @@ class OsuCmds(commands.Cog):
|
||||
|
||||
|
||||
@commands.command()
|
||||
async def osu_acc(self, ctx, arg, argF=None):
|
||||
if argF is None:
|
||||
test_acc = await ask_osu_acc(arg)
|
||||
async def osu_acc(self, ctx, username, x=None):
|
||||
if x is None:
|
||||
test_acc = await ask_osu_acc(username)
|
||||
if test_acc:
|
||||
embed = discord.Embed()
|
||||
embed.set_author(name='Osu! - Accuracy', icon_url=r'https://upload.wikimedia.org/wikipedia/commons/4/44/Osu%21Logo_%282019%29.png')
|
||||
|
||||
+3
-4
@@ -1,6 +1,5 @@
|
||||
import discord
|
||||
import asyncio
|
||||
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands.cooldowns import BucketType
|
||||
|
||||
@@ -14,9 +13,9 @@ class OtherCmds(commands.Cog):
|
||||
|
||||
@commands.command()
|
||||
@commands.cooldown(1, 2, commands.BucketType.guild)
|
||||
async def issou(self, ctx, arg1: discord.User = None):
|
||||
if arg1 is not None:
|
||||
user = arg1
|
||||
async def issou(self, ctx, username: discord.User = None):
|
||||
if username is not None:
|
||||
user = username
|
||||
else:
|
||||
user = ctx.message.author
|
||||
try:
|
||||
|
||||
@@ -77,7 +77,7 @@ class TwitchCmds(commands.Cog):
|
||||
self.bot = bot
|
||||
|
||||
@commands.command()
|
||||
async def chat_set(self, ctx, arg1):
|
||||
async def chat_set(self, ctx, channel_name):
|
||||
try:
|
||||
await ctx.message.delete()
|
||||
except discord.errors.Forbidden:
|
||||
@@ -86,10 +86,10 @@ class TwitchCmds(commands.Cog):
|
||||
if what_channel in list(chats):
|
||||
await ctx.send("```A chat is already active, you have to stop it before with the cmd $chat_stop !```")
|
||||
else:
|
||||
if check_user(arg1):
|
||||
obj = ChatObj(arg1, what_channel, self.bot)
|
||||
if check_user(channel_name):
|
||||
obj = ChatObj(channel_name, what_channel, self.bot)
|
||||
if obj.chat_init():
|
||||
await ctx.send(f'```Now connected to {arg1}\'s twitch channel !```')
|
||||
await ctx.send(f'```Now connected to {channel_name}\'s twitch channel !```')
|
||||
obj.twitch.start()
|
||||
else:
|
||||
await ctx.send('```Something went wrong when trying to access Twitch IRC.```')
|
||||
|
||||
Reference in New Issue
Block a user