mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-17 15:22:10 +00:00
Bugfixy
This commit is contained in:
@@ -122,6 +122,7 @@ for key in word_reactions:
|
|||||||
|
|
||||||
# *=========================================== Create Client
|
# *=========================================== Create Client
|
||||||
client = commands.Bot(intents=intents, command_prefix="$")
|
client = commands.Bot(intents=intents, command_prefix="$")
|
||||||
|
|
||||||
# *=========================================== Define Events
|
# *=========================================== Define Events
|
||||||
|
|
||||||
|
|
||||||
@@ -129,6 +130,8 @@ client = commands.Bot(intents=intents, command_prefix="$")
|
|||||||
async def on_ready():
|
async def on_ready():
|
||||||
logger.debug(f"{client.user} has connected to Discrod!")
|
logger.debug(f"{client.user} has connected to Discrod!")
|
||||||
await client.change_presence(activity=discord.Game(name="Axe Throwing Darts"))
|
await client.change_presence(activity=discord.Game(name="Axe Throwing Darts"))
|
||||||
|
await client.tree.sync()
|
||||||
|
#await tree.sync(guild=discord.Object(id=Your guild id))
|
||||||
await check()
|
await check()
|
||||||
|
|
||||||
|
|
||||||
@@ -175,7 +178,7 @@ async def on_message(message):
|
|||||||
|
|
||||||
if tdelta > INITIAL_TIME_WAIT:
|
if tdelta > INITIAL_TIME_WAIT:
|
||||||
for word in word_reactions:
|
for word in word_reactions:
|
||||||
if re.search(".*" + word + "[\s*,$]*", message.content):
|
if re.search(r"\b" + word + r"\b", message.content):
|
||||||
tdelta = datetime.now() - word_reactions[word][2]
|
tdelta = datetime.now() - word_reactions[word][2]
|
||||||
tdelta = tdelta.total_seconds()
|
tdelta = tdelta.total_seconds()
|
||||||
reaction = word_reactions[word][3]
|
reaction = word_reactions[word][3]
|
||||||
@@ -699,8 +702,8 @@ async def max_weight(list):
|
|||||||
|
|
||||||
# *=========================================== Define Commands
|
# *=========================================== Define Commands
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "dej_co_ze_spotifaja", description = "Podaj link do spotify - sciagnie i doda muzyke", guild=discord.Object(id=664789470779932693))
|
||||||
async def dej_co_ze_spotifaja(ctx):
|
async def dej_co_ze_spotifaja(ctx):
|
||||||
logger.info("Spotifaj")
|
logger.info("Spotifaj")
|
||||||
await ctx.send("Dej mnie chwilkę")
|
await ctx.send("Dej mnie chwilkę")
|
||||||
@@ -734,8 +737,8 @@ async def dej_co_ze_spotifaja(ctx):
|
|||||||
)
|
)
|
||||||
logger.info("Spotifaj udany")
|
logger.info("Spotifaj udany")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "dej_co_z_jutuba", description = "Podaj link do youtube - sciagnie i doda muzyke",guild=discord.Object(id=664789470779932693))
|
||||||
async def dej_co_z_jutuba(ctx):
|
async def dej_co_z_jutuba(ctx):
|
||||||
await ctx.send("Dej mnie chwilkę")
|
await ctx.send("Dej mnie chwilkę")
|
||||||
logger.info("Jutub")
|
logger.info("Jutub")
|
||||||
@@ -758,9 +761,9 @@ async def dej_co_z_jutuba(ctx):
|
|||||||
await ctx.send("Dodałem do listy {}".format(file))
|
await ctx.send("Dodałem do listy {}".format(file))
|
||||||
logger.info("Jutub udany")
|
logger.info("Jutub udany")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "update_banlist", description = "Jeśli nie wiesz jak użyć tej komendy to nawet nie próbuj",guild=discord.Object(id=664789470779932693))
|
||||||
async def update_banlist(ctx, arg=None):
|
async def update_banlist(ctx):
|
||||||
async with channel.typing():
|
async with channel.typing():
|
||||||
allowed = False
|
allowed = False
|
||||||
for role in ctx.author.roles:
|
for role in ctx.author.roles:
|
||||||
@@ -834,9 +837,9 @@ async def update_banlist(ctx, arg=None):
|
|||||||
)
|
)
|
||||||
await ctx.send("Zrobione tak czy inaczej")
|
await ctx.send("Zrobione tak czy inaczej")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(nsfw=True, name = "get_image_sadox", description = "Wyświetla losową stronę z losowego komiksu FanSadox. Bardzo NSFW.",guild=discord.Object(id=664789470779932693))
|
||||||
async def get_image_sadox(ctx, arg=None):
|
async def get_image_sadox(ctx):
|
||||||
logger.info("Get sadox")
|
logger.info("Get sadox")
|
||||||
channel = ctx.message.channel
|
channel = ctx.message.channel
|
||||||
async with channel.typing():
|
async with channel.typing():
|
||||||
@@ -869,9 +872,9 @@ async def get_image_sadox(ctx, arg=None):
|
|||||||
await ctx.send(file=file)
|
await ctx.send(file=file)
|
||||||
logger.info("Get sadox completed")
|
logger.info("Get sadox completed")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "graj_muzyko", description = "Włącza muzykę na kanale #nocna-zmiana.",guild=discord.Object(id=664789470779932693))
|
||||||
async def graj_muzyko(ctx, arg=None):
|
async def graj_muzyko(ctx):
|
||||||
logger.info("Press play on tape")
|
logger.info("Press play on tape")
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
global MUZYKA
|
global MUZYKA
|
||||||
@@ -881,9 +884,9 @@ async def graj_muzyko(ctx, arg=None):
|
|||||||
await play(ctx=ctx)
|
await play(ctx=ctx)
|
||||||
logger.info("Press play on tape completed")
|
logger.info("Press play on tape completed")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "cisza", description = "Wyłącza muzykę i czyści plejliste.",guild=discord.Object(id=664789470779932693))
|
||||||
async def cisza(ctx, arg=None):
|
async def cisza(ctx):
|
||||||
logger.info("Stop")
|
logger.info("Stop")
|
||||||
global MUZYKA
|
global MUZYKA
|
||||||
MUZYKA["playing"] = False
|
MUZYKA["playing"] = False
|
||||||
@@ -896,9 +899,9 @@ async def cisza(ctx, arg=None):
|
|||||||
MUZYKA["requestor"].pop()
|
MUZYKA["requestor"].pop()
|
||||||
logger.info("Stop completed")
|
logger.info("Stop completed")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "dalej", description = "Przerzuca na następny kawałek",guild=discord.Object(id=664789470779932693))
|
||||||
async def dalej(ctx, arg=None):
|
async def dalej(ctx):
|
||||||
logger.info("Next")
|
logger.info("Next")
|
||||||
voiceClient = client.voice_clients[0]
|
voiceClient = client.voice_clients[0]
|
||||||
if voiceClient.is_connected():
|
if voiceClient.is_connected():
|
||||||
@@ -906,18 +909,18 @@ async def dalej(ctx, arg=None):
|
|||||||
await play(ctx=ctx)
|
await play(ctx=ctx)
|
||||||
logger.info("Next completed")
|
logger.info("Next completed")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "daj_mi_chwile", description = "Pauzuje",guild=discord.Object(id=664789470779932693))
|
||||||
async def daj_mi_chwile(ctx, arg=None):
|
async def daj_mi_chwile(ctx):
|
||||||
logger.info("Pause")
|
logger.info("Pause")
|
||||||
voiceClient = client.voice_clients[0]
|
voiceClient = client.voice_clients[0]
|
||||||
if voiceClient.is_connected():
|
if voiceClient.is_connected():
|
||||||
voiceClient.pause()
|
voiceClient.pause()
|
||||||
logger.info("Pause completed")
|
logger.info("Pause completed")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "graj_dalej", description = "Odpauzowuje",guild=discord.Object(id=664789470779932693))
|
||||||
async def graj_dalej(ctx, arg=None):
|
async def graj_dalej(ctx):
|
||||||
logger.info("Unpause")
|
logger.info("Unpause")
|
||||||
voiceClient = client.voice_clients[0]
|
voiceClient = client.voice_clients[0]
|
||||||
if voiceClient.is_paused():
|
if voiceClient.is_paused():
|
||||||
@@ -925,13 +928,9 @@ async def graj_dalej(ctx, arg=None):
|
|||||||
logger.info("Unpause completed")
|
logger.info("Unpause completed")
|
||||||
|
|
||||||
|
|
||||||
@client.command()
|
#@client.command()
|
||||||
async def zagraj_muzyke_mego_ludu(ctx, arg=None):
|
@client.hybrid_command(name = "zagraj_mi_kawalek", description = "Wyszukuje w bibliotece muzycznej Hammera kawałek który ma zostać zagrany",guild=discord.Object(id=664789470779932693))
|
||||||
pass
|
async def zagraj_mi_kawalek(ctx):
|
||||||
|
|
||||||
|
|
||||||
@client.command()
|
|
||||||
async def zagraj_mi_kawalek(ctx, arg=None):
|
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
search_time_glob = datetime.now()
|
search_time_glob = datetime.now()
|
||||||
logger.info("Zaczynam szukać timestamp {}".format(datetime.now()))
|
logger.info("Zaczynam szukać timestamp {}".format(datetime.now()))
|
||||||
@@ -957,21 +956,21 @@ async def zagraj_mi_kawalek(ctx, arg=None):
|
|||||||
if metadata.tag.album:
|
if metadata.tag.album:
|
||||||
reply += " z albumu {}".format(metadata.tag.album)
|
reply += " z albumu {}".format(metadata.tag.album)
|
||||||
reply += " z prywatnej kolekcji Hammera i na Twoją specjalną rpośbę."
|
reply += " z prywatnej kolekcji Hammera i na Twoją specjalną rpośbę."
|
||||||
await ctx.reply(reply)
|
await ctx.send(reply)
|
||||||
else:
|
else:
|
||||||
await ctx.reply(
|
await ctx.send(
|
||||||
"Obawiam się że nie mogę nic znaleźć u siebie. Spróbuj komendy '$dej_co_ze_spotifaja' jeśli masz link"
|
"Obawiam się że nie mogę nic znaleźć u siebie. Spróbuj komendy '$dej_co_ze_spotifaja' jeśli masz link"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "zrob_mi_plejliste", description = "Generuje playliste - param1 - dlugosc, potem slowa wyszukiwania",guild=discord.Object(id=664789470779932693))
|
||||||
async def zrob_mi_plejliste(ctx, *arg):
|
async def zrob_mi_plejliste(ctx):
|
||||||
reply = "Wygenerowana plejlista:\n"
|
reply = "Wygenerowana plejlista:\n"
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
logger.info("Zaczynam szukać timestamp {}".format(datetime.now()))
|
logger.info("Zaczynam szukać timestamp {}".format(datetime.now()))
|
||||||
search_time_glob = datetime.now()
|
search_time_glob = datetime.now()
|
||||||
|
|
||||||
dlugosc_playlisty = arg[0]
|
dlugosc_playlisty = ctx.message.content.split()[0]
|
||||||
file = await wyszukaj(ctx=ctx, how_many=dlugosc_playlisty)
|
file = await wyszukaj(ctx=ctx, how_many=dlugosc_playlisty)
|
||||||
logger.info(
|
logger.info(
|
||||||
"Koniec szukania(timestamp {} zajęło {}".format(
|
"Koniec szukania(timestamp {} zajęło {}".format(
|
||||||
@@ -1000,18 +999,18 @@ async def zrob_mi_plejliste(ctx, *arg):
|
|||||||
reply += " z prywatnej kolekcji Hammera i na Twoją specjalną rpośbę.\n"
|
reply += " z prywatnej kolekcji Hammera i na Twoją specjalną rpośbę.\n"
|
||||||
index+=1
|
index+=1
|
||||||
if len(reply) > 1800:
|
if len(reply) > 1800:
|
||||||
await ctx.reply(reply)
|
await ctx.send(reply)
|
||||||
reply = ""
|
reply = ""
|
||||||
else:
|
else:
|
||||||
await ctx.reply(
|
await ctx.send(
|
||||||
"Obawiam się że nie mogę nic znaleźć u siebie. Spróbuj komendy '$dej_co_ze_spotifaja' jeśli masz link"
|
"Obawiam się że nie mogę nic znaleźć u siebie. Spróbuj komendy '$dej_co_ze_spotifaja' jeśli masz link"
|
||||||
)
|
)
|
||||||
await ctx.reply(reply)
|
await ctx.send(reply)
|
||||||
logger.info("Plejlista zrobiona")
|
logger.info("Plejlista zrobiona")
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "przytul", description = "Przytul kogoś - daj mention po komendzie :)")
|
||||||
async def przytul(ctx, arg=None):
|
async def przytul(ctx, arg:discord.Member=None):
|
||||||
async with ctx.typing():
|
async with ctx.typing():
|
||||||
nieprzytulac = False
|
nieprzytulac = False
|
||||||
for mention in ctx.message.mentions:
|
for mention in ctx.message.mentions:
|
||||||
@@ -1026,28 +1025,23 @@ async def przytul(ctx, arg=None):
|
|||||||
elif arg:
|
elif arg:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
"Już dobrze.... Już dobrze... Ojej.. Biedactwo... :( *W ułamku sekundy {} znajduje sie w duszącym uścisku. Żebra trzeszczą - kilka pęka. Pacnięcia po plecach grożą odbiciem nerek, a głaskanie po głowie powoduje wstrząs mózgu*".format(
|
"Już dobrze.... Już dobrze... Ojej.. Biedactwo... :( *W ułamku sekundy {} znajduje sie w duszącym uścisku. Żebra trzeszczą - kilka pęka. Pacnięcia po plecach grożą odbiciem nerek, a głaskanie po głowie powoduje wstrząs mózgu*".format(
|
||||||
arg
|
arg.mention
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await ctx.message.add_reaction("\U0001fac2")
|
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
"Kogo mam przytulić? *Wyłamuje kostki i przeciąga się - jego 200 kilowa sylwetka złożona z samych mięśni świadczy o tym że jest gotowy*"
|
"Kogo mam przytulić? *Wyłamuje kostki i przeciąga się - jego 200 kilowa sylwetka złożona z samych mięśni świadczy o tym że jest gotowy*"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@client.command()
|
#@client.command()
|
||||||
async def get_image_stable_diffusion(ctx, arg=None):
|
@client.hybrid_command(name = "fabryczka", description = "Historia fabryczki")
|
||||||
pass
|
async def fabryczka(ctx):
|
||||||
|
await ctx.send(historia_fabryczki)
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
@client.command()
|
@client.hybrid_command(name = "chata_hammera", description = "Czas od ostatniego incydentu w AbsinthHammerTimeSpaceContinuum")
|
||||||
async def fabryczka(ctx, arg=None):
|
async def chata_hammera(ctx):
|
||||||
await ctx.message.reply(historia_fabryczki)
|
|
||||||
|
|
||||||
|
|
||||||
@client.command()
|
|
||||||
async def chata_hammera(ctx, arg=None):
|
|
||||||
with open(accident_log, "r+") as new_file:
|
with open(accident_log, "r+") as new_file:
|
||||||
# First we load existing data into a dict.
|
# First we load existing data into a dict.
|
||||||
file_data = json.load(new_file)
|
file_data = json.load(new_file)
|
||||||
@@ -1060,8 +1054,9 @@ async def chata_hammera(ctx, arg=None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@client.command()
|
@client.hybrid_command(name = "historia_incydentow_u_hammera", description = "Wyswietla liste incydentów które miały miejsce w AbsinthHammerTimeSpaceContinuum.")
|
||||||
async def historia_incydentow_u_hammera(ctx, arg=None):
|
#@client.command()
|
||||||
|
async def historia_incydentow_u_hammera(ctx):
|
||||||
with open(accident_log, "r+") as new_file:
|
with open(accident_log, "r+") as new_file:
|
||||||
# First we load existing data into a dict.
|
# First we load existing data into a dict.
|
||||||
file_data = json.load(new_file)
|
file_data = json.load(new_file)
|
||||||
@@ -1076,8 +1071,9 @@ async def historia_incydentow_u_hammera(ctx, arg=None):
|
|||||||
await ctx.send(return_data)
|
await ctx.send(return_data)
|
||||||
|
|
||||||
|
|
||||||
@client.command()
|
@client.hybrid_command(name = "reset_the_clock", description = "Resetowanie zegara - dostępne wyłącznie dla Hammera", guild=discord.Object(id=664789470779932693))
|
||||||
async def reset_the_clock(ctx, arg=None):
|
#@client.command()
|
||||||
|
async def reset_the_clock(ctx):
|
||||||
hammer = False
|
hammer = False
|
||||||
for role in ctx.message.author.roles:
|
for role in ctx.message.author.roles:
|
||||||
if role.name == "Bartender":
|
if role.name == "Bartender":
|
||||||
@@ -1105,6 +1101,14 @@ async def reset_the_clock(ctx, arg=None):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
|
async def get_image_stable_diffusion(ctx):
|
||||||
|
pass
|
||||||
|
|
||||||
|
#@client.command()
|
||||||
|
#@client.hybrid_command()
|
||||||
|
async def zagraj_muzyke_mego_ludu(ctx):
|
||||||
|
pass
|
||||||
|
|
||||||
# *================================== Run
|
# *================================== Run
|
||||||
client.run(TOKEN)
|
client.run(TOKEN)
|
||||||
|
|||||||
Reference in New Issue
Block a user