feat: fixed up the changes

This commit is contained in:
silver 2025-02-18 13:36:08 +00:00
parent c79113921d
commit cab04a068f
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D
11 changed files with 62 additions and 47 deletions

View file

@ -199,11 +199,11 @@ pub mod committee {
for committee in &committees {
// get the role for this committee/club/soc
let role = match roles_name.get(&committee.name) {
let role = match roles_name.get(&committee.name_profile) {
Some(x) => Some(x.to_owned()),
None => {
// create teh role if it does not exist
match server.create_role(&ctx, |r| r.hoist(false).mentionable(true).name(&committee.name)).await {
match server.create_role(&ctx, |r| r.hoist(false).mentionable(true).name(&committee.name_profile)).await {
Ok(x) => Some(x),
Err(_) => None,
}
@ -211,16 +211,16 @@ pub mod committee {
};
// create teh channel if it does nto exist
if !channels_name.contains_key(&committee.name) {
if !channels_name.contains_key(&committee.name_profile) {
match server
.create_channel(&ctx, |c| c.name(&committee.name).kind(ChannelType::Text).category(config.committee_category))
.create_channel(&ctx, |c| c.name(&committee.name_profile).kind(ChannelType::Text).category(config.committee_category))
.await
{
Ok(x) => {
// update teh channels name list
channels_name.insert(x.name.to_owned(), x.to_owned());
println!("Created channel: {}", &committee.name);
println!("Created channel: {}", &committee.name_profile);
}
Err(x) => {
dbg!("Unable to create channel: ", x);