Skip to content

Commit

Permalink
refactor: moved lot of functions to a package
Browse files Browse the repository at this point in the history
Big changes are coming 👀
  • Loading branch information
TheTipo01 committed Oct 21, 2023
1 parent d0e0569 commit 4def652
Show file tree
Hide file tree
Showing 22 changed files with 1,319 additions and 1,262 deletions.
310 changes: 129 additions & 181 deletions commands.go

Large diffs are not rendered by default.

75 changes: 0 additions & 75 deletions constant.go

This file was deleted.

73 changes: 73 additions & 0 deletions constants/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package constants

const (
CachePath = "./audio_cache/"
AudioExtension = ".dca"
)

// Titles for embeds
const (
EnqueuedTitle = "Enqueued"
ErrorTitle = "Error"
SkipTitle = "Skipped"
QueueTitle = "Queue"
PauseTitle = "Pause"
DisconnectedTitle = "Disconnected"
GotoTitle = "Goto"
StatsTitle = "Stats™"
RestartTitle = "Restart"
SuccessfulTitle = "Successful"
CommandsTitle = "Commands"
BlacklistTitle = "Blacklist"
ResumeTitle = "Resume"
DjTitle = "DJ"
)

// Messages for embeds
const (
// Voice channel
NotInVC = "You're not in a voice channel in this guild!"
CantJoinVC = "Can't join voice channel!"

// Queue
QueueCleared = "Queue cleared!"
QueueEmpty = "Queue is empty!"

// Song status
Paused = "Paused the current song"
AlreadyPaused = "The song is already paused"
Resumed = "Resumed the current song"
AlreadyResumed = "The song is already playing"
SkippedTo = "Skipped to "

// Custom commands
CommandAdded = "Custom command added!"
CommandRemoved = "Custom command removed!"
CommandInvalid = "Not a valid custom command!\nSee /listcustom for a list of custom commands."

// Errors
NotCached = "Song is not cached!"
InvalidURL = "Invalid URL!"
StillPlaying = "Can't disconnect the bot!\nStill playing in a voice channel."
GotoInvalid = "Wrong format.\nValid formats are: 1h10m3s, 3m, 4m10s..."
NothingPlaying = "No song playing!"
SpotifyError = "Can't get info about spotify link!\nError code: "
SpotifyNotConfigure = "Spotify is not configured!\nSee the documentation for more info."
CommandExists = "Command already exists!"
CommandNotExists = "Command doesn't exist!"

// Feedback
Disconnected = "Bye-bye!"

// DJ
DjEnabled = "DJ mode enabled!"
DjDisabled = "DJ mode disabled!"
DjNot = "User is not a DJ, and DJ mode is enabled!"
DjRoleChanged = "DJ role changed!"
DjRoleEqual = "DJ role is already that role!"
)

const (
// How many DCA frames are needed for a second. It's not perfect, but good enough.
FrameSeconds = 50.00067787
)
Loading

0 comments on commit 4def652

Please sign in to comment.