mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Changing file organization
This commit is contained in:
parent
9eda65886e
commit
d67997140f
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
examples
|
examples
|
||||||
.env
|
.env
|
||||||
|
errors
|
||||||
@ -1,34 +0,0 @@
|
|||||||
from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument
|
|
||||||
from discord.ext import commands
|
|
||||||
|
|
||||||
|
|
||||||
class Control(commands.Cog):
|
|
||||||
"""Control the flow of the Bot"""
|
|
||||||
|
|
||||||
def __init__(self, bot):
|
|
||||||
self.__bot = bot
|
|
||||||
|
|
||||||
@property
|
|
||||||
def bot(self):
|
|
||||||
return self.__bot
|
|
||||||
|
|
||||||
@bot.setter
|
|
||||||
def bot(self, newBot):
|
|
||||||
self.__bot = newBot
|
|
||||||
|
|
||||||
@commands.Cog.listener()
|
|
||||||
async def on_ready(self):
|
|
||||||
print(f'Bot {self.__bot.user.name} inicializado')
|
|
||||||
|
|
||||||
@commands.Cog.listener()
|
|
||||||
async def on_command_error(self, ctx, error):
|
|
||||||
if isinstance(error, MissingRequiredArgument):
|
|
||||||
await ctx.channel.send(f'Falta argumentos. Digite {self.__bot.prefix}help para ver os comandos')
|
|
||||||
elif isinstance(error, CommandNotFound):
|
|
||||||
await ctx.channel.send(f'O comando não existe')
|
|
||||||
else:
|
|
||||||
raise error
|
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
|
||||||
bot.add_cog(Control(bot))
|
|
||||||
63
config/config.py
Normal file
63
config/config.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
from dotenv import dotenv_values
|
||||||
|
|
||||||
|
CETUS_API = dotenv_values('.env')['CETUS_API']
|
||||||
|
BOT_TOKEN = dotenv_values('.env')['BOT_TOKEN']
|
||||||
|
SPOTIFY_ID = dotenv_values('.env')['SPOTIFY_ID']
|
||||||
|
SPOTIFY_SECRET = dotenv_values('.env')['SPOTIFY_SECRET']
|
||||||
|
|
||||||
|
BOT_PREFIX = '!'
|
||||||
|
INITIAL_EXTENSIONS = {'cogs'}
|
||||||
|
|
||||||
|
VC_TIMEOUT = 600 # seconds
|
||||||
|
VC_TIMEOUT_DEFAULT = True
|
||||||
|
|
||||||
|
STARTUP_MESSAGE = 'Starting Vulkan...'
|
||||||
|
STARTUP_COMPLETE_MESSAGE = 'Vulkan is now operating.'
|
||||||
|
|
||||||
|
USER_NOT_IN_VC_MESSAGE = "Error: Please join the active voice channel to use this command"
|
||||||
|
NOT_CONNECTED_MESSAGE = "Error: Bot not connected to any voice channel"
|
||||||
|
ALREADY_CONNECTED_MESSAGE = "Error: Already connected to a voice channel"
|
||||||
|
CHANNEL_NOT_FOUND_MESSAGE = "Error: Could not find channel"
|
||||||
|
|
||||||
|
INFO_HISTORY_TITLE = "Songs Played:"
|
||||||
|
MAX_HISTORY_LENGTH = 10
|
||||||
|
MAX_TRACKNAME_HISTORY_LENGTH = 15
|
||||||
|
|
||||||
|
SONGINFO_UPLOADER = "Uploader: "
|
||||||
|
SONGINFO_DURATION = "Duration: "
|
||||||
|
SONGINFO_SECONDS = "s"
|
||||||
|
SONGINFO_LIKES = "Likes: "
|
||||||
|
SONGINFO_DISLIKES = "Dislikes: "
|
||||||
|
SONGINFO_NOW_PLAYING = "Now Playing"
|
||||||
|
SONGINFO_QUEUE_ADDED = "Added to queue"
|
||||||
|
SONGINFO_SONGINFO = "Song info"
|
||||||
|
SONGINFO_PLAYLIST_QUEUED = "Queued playlist :page_with_curl:"
|
||||||
|
SONGINFO_UNKNOWN_DURATION = "Unknown"
|
||||||
|
|
||||||
|
|
||||||
|
HELP_HISTORY_LONG = "Shows the " + \
|
||||||
|
str(MAX_TRACKNAME_HISTORY_LENGTH) + " last played songs."
|
||||||
|
HELP_PAUSE_LONG = "Pauses the AudioPlayer. Playback can be continued with the resume command."
|
||||||
|
HELP_VOL_LONG = "Changes the volume of the AudioPlayer. Argument specifies the % to which the volume should be set."
|
||||||
|
HELP_PREV_LONG = "Plays the previous song again."
|
||||||
|
HELP_RESUME_LONG = "Resumes the AudioPlayer."
|
||||||
|
HELP_SKIP_LONG = "Skips the currently playing song and goes to the next item in the queue."
|
||||||
|
HELP_SONGINFO_LONG = "Shows details about the song currently being played and posts a link to the song."
|
||||||
|
HELP_STOP_LONG = "Stops the AudioPlayer and clears the songqueue"
|
||||||
|
HELP_YT_LONG = (
|
||||||
|
"$p [link/video title/key words/playlist-link/soundcloud link/spotify link/bandcamp link/twitter link]")
|
||||||
|
HELP_CLEAR_LONG = "Clears the queue."
|
||||||
|
HELP_LOOP_LONG = "Loops the currently playing song and locks the queue. Use the command again to disable loop."
|
||||||
|
HELP_QUEUE_LONG = "Shows the number of songs in queue, up to 10."
|
||||||
|
HELP_SHUFFLE_LONG = "Randomly sort the songs in the current queue"
|
||||||
|
|
||||||
|
ABSOLUTE_PATH = ''
|
||||||
|
COOKIE_PATH = '/config/cookies/cookies.txt'
|
||||||
|
|
||||||
|
|
||||||
|
COLOURS = {
|
||||||
|
'red': 0xDC143C,
|
||||||
|
'green': 0x00FF7F,
|
||||||
|
'grey': 0x708090,
|
||||||
|
'blue': 0x0000CD
|
||||||
|
}
|
||||||
0
config/cookies/cookies.txt
Normal file
0
config/cookies/cookies.txt
Normal file
@ -2,6 +2,7 @@ import requests
|
|||||||
import json
|
import json
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
|
from random import random as rand
|
||||||
|
|
||||||
|
|
||||||
class Phrases(commands.Cog):
|
class Phrases(commands.Cog):
|
||||||
@ -20,6 +21,11 @@ class Phrases(commands.Cog):
|
|||||||
|
|
||||||
@commands.command(name='frase', help='Envia uma frase legal no seu PV')
|
@commands.command(name='frase', help='Envia uma frase legal no seu PV')
|
||||||
async def send_phrase(self, ctx):
|
async def send_phrase(self, ctx):
|
||||||
|
# There is a chance that the phrase will be send for the dev
|
||||||
|
sended = await self.calculate_rgn(ctx)
|
||||||
|
if sended:
|
||||||
|
return
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
@ -30,7 +36,7 @@ class Phrases(commands.Cog):
|
|||||||
author = data['quoteAuthor']
|
author = data['quoteAuthor']
|
||||||
|
|
||||||
text = f'{phrase} \nBy: {author}'
|
text = f'{phrase} \nBy: {author}'
|
||||||
await ctx.author.send(text)
|
await ctx.send(text)
|
||||||
break
|
break
|
||||||
except json.decoder.JSONDecodeError:
|
except json.decoder.JSONDecodeError:
|
||||||
continue
|
continue
|
||||||
@ -43,6 +49,15 @@ class Phrases(commands.Cog):
|
|||||||
await ctx.channel.send('Houve um erro inesperado :/')
|
await ctx.channel.send('Houve um erro inesperado :/')
|
||||||
break
|
break
|
||||||
|
|
||||||
|
async def calculate_rgn(self, ctx):
|
||||||
|
x = rand()
|
||||||
|
print(x)
|
||||||
|
if x < 0.15:
|
||||||
|
await ctx.send('Se leu seu cu é meu\nBy: Minha Pica')
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(Phrases(bot))
|
bot.add_cog(Phrases(bot))
|
||||||
Loading…
x
Reference in New Issue
Block a user