grim/wasdead
Clone
Summary
Browse
Changes
Graph
Fix the help message for the help command
draft
2019-04-08, Gary Kramlich
c06bc2e462ed
Fix the help message for the help command
package
database
import
(
"github.com/go-redis/redis"
)
type
db_redis
struct
{
database
*
redis
.
Client
}
func
init
()
{
database
:=
redis
.
NewClient
(
&
redis
.
Options
{
Addr
:
"localhost:6379"
,
Password
:
""
,
// no password set
DB
:
0
,
// use default DB
})
Register
(
"redis"
,
db_redis
{
database
:
database
,
})
}
func
(
db
db_redis
)
GetChannel
(
guildid
string
)
string
{
data
,
err
:=
db
.
database
.
Get
(
guildid
).
Result
()
if
err
!=
nil
{
return
""
}
return
data
}
func
(
db
db_redis
)
SetChannel
(
guildid
,
channel
string
)
{
db
.
database
.
Set
(
guildid
,
[]
byte
(
channel
),
0
)
}
func
(
db
db_redis
)
Close
()
{
db
.
database
.
Close
()
}