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.command()
|
||||||
@commands.cooldown(1, 2, commands.BucketType.user)
|
@commands.cooldown(1, 2, commands.BucketType.user)
|
||||||
async def lol_rank(self, ctx, arg, argf=None):
|
async def lol_rank(self, ctx, invocator_name, x=None):
|
||||||
if argf is None:
|
if x is None:
|
||||||
player = what_player(arg)
|
player = what_player(invocator_name)
|
||||||
if player != 0:
|
if player != 0:
|
||||||
ranks = rank_track(player)
|
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(
|
embed.set_thumbnail(url='http://ddragon.leagueoflegends.com/cdn/11.2.1/img/profileicon/' + str(
|
||||||
player['profileIconId']) + '.png')
|
player['profileIconId']) + '.png')
|
||||||
embed.set_author(name='League Of Legend - Rank', url='https://euw.leagueoflegends.com/en-gb/',
|
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
|
self.bot = bot
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def osu_profile(self, ctx, arg, argF=None):
|
async def osu_profile(self, ctx, username, x=None):
|
||||||
if argF is None:
|
if x is None:
|
||||||
lst = await ask_osu_profile(arg)
|
lst = await ask_osu_profile(username)
|
||||||
if lst == 1:
|
if lst == 1:
|
||||||
await ctx.send('The username you entered is unknown.')
|
await ctx.send('The username you entered is unknown.')
|
||||||
else:
|
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',
|
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')
|
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]))
|
embed.set_thumbnail(url='https://a.ppy.sh/' + str(lst[0]))
|
||||||
@@ -37,9 +37,9 @@ class OsuCmds(commands.Cog):
|
|||||||
|
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def osu_lastgame(self, ctx, arg, argF=None):
|
async def osu_lastgame(self, ctx, username, x=None):
|
||||||
if argF is None:
|
if x is None:
|
||||||
lst = await ask_osu_last_game(arg)
|
lst = await ask_osu_last_game(username)
|
||||||
if lst == 1:
|
if lst == 1:
|
||||||
await ctx.send('The player you entered is unknown or didn\'t played any game recently.')
|
await ctx.send('The player you entered is unknown or didn\'t played any game recently.')
|
||||||
else:
|
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) + '%'))
|
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='100', value=str(lst[13]))
|
||||||
embed.add_field(name='Katu', value=str(lst[16]))
|
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='50', value=str(lst[14]))
|
||||||
embed.add_field(name='Miss', value=str(lst[15]))
|
embed.add_field(name='Miss', value=str(lst[15]))
|
||||||
embed.add_field(name='|', value='|')
|
embed.add_field(name='|', value='|')
|
||||||
@@ -69,9 +69,9 @@ class OsuCmds(commands.Cog):
|
|||||||
|
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def osu_acc(self, ctx, arg, argF=None):
|
async def osu_acc(self, ctx, username, x=None):
|
||||||
if argF is None:
|
if x is None:
|
||||||
test_acc = await ask_osu_acc(arg)
|
test_acc = await ask_osu_acc(username)
|
||||||
if test_acc:
|
if test_acc:
|
||||||
embed = discord.Embed()
|
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')
|
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 discord
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from discord.ext.commands.cooldowns import BucketType
|
from discord.ext.commands.cooldowns import BucketType
|
||||||
|
|
||||||
@@ -14,9 +13,9 @@ class OtherCmds(commands.Cog):
|
|||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@commands.cooldown(1, 2, commands.BucketType.guild)
|
@commands.cooldown(1, 2, commands.BucketType.guild)
|
||||||
async def issou(self, ctx, arg1: discord.User = None):
|
async def issou(self, ctx, username: discord.User = None):
|
||||||
if arg1 is not None:
|
if username is not None:
|
||||||
user = arg1
|
user = username
|
||||||
else:
|
else:
|
||||||
user = ctx.message.author
|
user = ctx.message.author
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class TwitchCmds(commands.Cog):
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def chat_set(self, ctx, arg1):
|
async def chat_set(self, ctx, channel_name):
|
||||||
try:
|
try:
|
||||||
await ctx.message.delete()
|
await ctx.message.delete()
|
||||||
except discord.errors.Forbidden:
|
except discord.errors.Forbidden:
|
||||||
@@ -86,10 +86,10 @@ class TwitchCmds(commands.Cog):
|
|||||||
if what_channel in list(chats):
|
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 !```")
|
await ctx.send("```A chat is already active, you have to stop it before with the cmd $chat_stop !```")
|
||||||
else:
|
else:
|
||||||
if check_user(arg1):
|
if check_user(channel_name):
|
||||||
obj = ChatObj(arg1, what_channel, self.bot)
|
obj = ChatObj(channel_name, what_channel, self.bot)
|
||||||
if obj.chat_init():
|
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()
|
obj.twitch.start()
|
||||||
else:
|
else:
|
||||||
await ctx.send('```Something went wrong when trying to access Twitch IRC.```')
|
await ctx.send('```Something went wrong when trying to access Twitch IRC.```')
|
||||||
|
|||||||
Reference in New Issue
Block a user