Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Remilia Scarlet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reviath
Remilia Scarlet
Commits
e78e24b3
Commit
e78e24b3
authored
May 18, 2021
by
Reviath
Browse files
Options
Downloads
Patches
Plain Diff
Fixed GetPrefix function at multiplexer.
parent
f86d8bcb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#685
passed
May 18, 2021
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Multiplexer/GetPrefix.go
+2
-24
2 additions, 24 deletions
Multiplexer/GetPrefix.go
with
2 additions
and
24 deletions
Multiplexer/GetPrefix.go
+
2
−
24
View file @
e78e24b3
package
multiplexer
import
(
"encoding/json"
"fmt"
"io/ioutil"
)
var
(
BotPrefix
string
// BotPrefix is bot's prefix to cut prefix's length
config
*
configStruct
// config structure
...
...
@@ -15,23 +9,7 @@ type configStruct struct {
BotPrefix
string
`json:"BotPrefix"`
}
// GetPrefix returns to Bot's prefix from config
.json fil
e
// GetPrefix returns to Bot's prefix from config
packag
e
func
GetPrefix
()
string
{
file
,
err
:=
ioutil
.
ReadFile
(
"./config.json"
)
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
return
"err"
}
err
=
json
.
Unmarshal
(
file
,
&
config
)
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
return
"err"
}
BotPrefix
=
config
.
BotPrefix
return
BotPrefix
return
config
.
BotPrefix
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment