mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Some improvements
This commit is contained in:
parent
8022ac2cd3
commit
b39557ffed
1 changed files with 16 additions and 9 deletions
|
@ -185,7 +185,7 @@ async def on_ready():
|
||||||
async def on_message(message: discord.Message):
|
async def on_message(message: discord.Message):
|
||||||
global voice_client
|
global voice_client
|
||||||
global voice_player
|
global voice_player
|
||||||
if not message.content.startswith("!"):
|
if message.channel != client.get_channel(config["Discord"]["main_channel"]):
|
||||||
return
|
return
|
||||||
sentry.user_context({
|
sentry.user_context({
|
||||||
"discord": {
|
"discord": {
|
||||||
|
@ -194,14 +194,19 @@ async def on_message(message: discord.Message):
|
||||||
"discriminator": message.author.discriminator
|
"discriminator": message.author.discriminator
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if message.content.startswith("!"):
|
if not message.content.startswith("!") and not message.author.bot:
|
||||||
data = message.content.split(" ")
|
client.send_message(message.channel,
|
||||||
if data[0] not in commands:
|
":warning: In questa chat sono consentiti solo comandi per il bot.\n"
|
||||||
await client.send_message(message.channel, ":warning: Comando non riconosciuto.")
|
"Riinvia il tuo messaggio in <#425780562805129226>!")
|
||||||
return
|
client.delete_message(message)
|
||||||
await commands[data[0]](channel=client.get_channel(config["Discord"]["main_channel"]),
|
return
|
||||||
author=message.author,
|
data = message.content.split(" ")
|
||||||
params=data)
|
if data[0] not in commands:
|
||||||
|
await client.send_message(message.channel, ":warning: Comando non riconosciuto.")
|
||||||
|
return
|
||||||
|
await commands[data[0]](channel=client.get_channel(config["Discord"]["main_channel"]),
|
||||||
|
author=message.author,
|
||||||
|
params=data)
|
||||||
|
|
||||||
|
|
||||||
async def update_users_pipe(users_connection):
|
async def update_users_pipe(users_connection):
|
||||||
|
@ -526,6 +531,8 @@ commands = {
|
||||||
"!cv": cmd_cv,
|
"!cv": cmd_cv,
|
||||||
"!play": cmd_play,
|
"!play": cmd_play,
|
||||||
"!p": cmd_play,
|
"!p": cmd_play,
|
||||||
|
"!search": cmd_play,
|
||||||
|
"!file": cmd_play,
|
||||||
"!skip": cmd_skip,
|
"!skip": cmd_skip,
|
||||||
"!s": cmd_skip,
|
"!s": cmd_skip,
|
||||||
"!remove": cmd_remove,
|
"!remove": cmd_remove,
|
||||||
|
|
Loading…
Reference in a new issue