Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UCC
Discord Bot
Commits
113aa294
Unverified
Commit
113aa294
authored
Jan 31, 2020
by
tec
Browse files
Fix file-weirdness with config.rs (was symlink)
parent
ff146c32
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/config.rs
deleted
120000 → 0
View file @
ff146c32
use
serenity
;
use
std
::
fs
;
use
serde
::
Deserialize
;
use
toml
;
lazy_static!
{
static
ref
CONFIG_FILE
:
String
=
fs
::
read_to_string
(
"config.toml"
)
.unwrap
();
}
lazy_static!
{
pub
static
ref
CONFIG
:
UccbotConfig
=
toml
::
from_str
(
&
CONFIG_FILE
)
.unwrap
();
}
#[derive(Deserialize)]
pub
struct
UccbotConfig
{
pub
server_id
:
u64
,
// #general
pub
main_channel
:
serenity
::
model
::
id
::
ChannelId
,
// #the-corner
pub
welcome_channel
:
serenity
::
model
::
id
::
ChannelId
,
// #general
pub
announcement_channel
:
serenity
::
model
::
id
::
ChannelId
,
pub
bot_id
:
u64
,
pub
vote_pool_size
:
i8
,
pub
vote_role
:
u64
,
pub
tiebreaker_role
:
u64
,
pub
unregistered_member_role
:
u64
,
pub
registered_member_role
:
u64
,
pub
command_prefix
:
&
'static
str
,
pub
for_vote
:
&
'static
str
,
pub
against_vote
:
&
'static
str
,
pub
abstain_vote
:
&
'static
str
,
pub
approve_react
:
&
'static
str
,
pub
disapprove_react
:
&
'static
str
,
pub
unsure_react
:
&
'static
str
,
}
impl
UccbotConfig
{
pub
fn
allowed_reacts
(
&
self
)
->
Vec
<
String
>
{
vec!
(
self
.for_vote
.to_string
(),
self
.against_vote
.to_string
(),
self
.abstain_vote
.to_string
(),
self
.approve_react
.to_string
(),
self
.disapprove_react
.to_string
(),
self
.unsure_react
.to_string
())
}
}
\ No newline at end of file
src/config.rs
0 → 100644
View file @
113aa294
use
serenity
;
use
std
::
fs
;
use
serde
::
Deserialize
;
use
toml
;
lazy_static!
{
static
ref
CONFIG_FILE
:
String
=
fs
::
read_to_string
(
"config.toml"
)
.unwrap
();
}
lazy_static!
{
pub
static
ref
CONFIG
:
UccbotConfig
=
toml
::
from_str
(
&
CONFIG_FILE
)
.unwrap
();
}
#[derive(Deserialize)]
pub
struct
UccbotConfig
{
pub
server_id
:
u64
,
// #general
pub
main_channel
:
serenity
::
model
::
id
::
ChannelId
,
// #the-corner
pub
welcome_channel
:
serenity
::
model
::
id
::
ChannelId
,
// #general
pub
announcement_channel
:
serenity
::
model
::
id
::
ChannelId
,
pub
bot_id
:
u64
,
pub
vote_pool_size
:
i8
,
pub
vote_role
:
u64
,
pub
tiebreaker_role
:
u64
,
pub
unregistered_member_role
:
u64
,
pub
registered_member_role
:
u64
,
pub
command_prefix
:
&
'static
str
,
pub
for_vote
:
&
'static
str
,
pub
against_vote
:
&
'static
str
,
pub
abstain_vote
:
&
'static
str
,
pub
approve_react
:
&
'static
str
,
pub
disapprove_react
:
&
'static
str
,
pub
unsure_react
:
&
'static
str
,
}
impl
UccbotConfig
{
pub
fn
allowed_reacts
(
&
self
)
->
Vec
<
String
>
{
vec!
(
self
.for_vote
.to_string
(),
self
.against_vote
.to_string
(),
self
.abstain_vote
.to_string
(),
self
.approve_react
.to_string
(),
self
.disapprove_react
.to_string
(),
self
.unsure_react
.to_string
())
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment