Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ArmaforcesMissionBot/Helpers/SignupHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ await signupChannel.ModifyAsync(x =>
// really hacky solution to avoid recalculating indexes for each channel integer should have
// space for around 68 years, and this bot is not going to work this long for sure
x.Position = index;
x.Name = mission.Title;
});

var mainEmbed = await CreateMainEmbed(guild, mission);
Expand Down
25 changes: 25 additions & 0 deletions ArmaforcesMissionBot/Modules/Signups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,31 @@ public async Task EditMission(int missionNo)
}
}

[Command("edytuj-nazwe-misji")]
[Summary("Edycja nazwy już utworzonej misji.")]
[ContextDMOrChannel]
public async Task MissionName([Remainder] string newTitle)
{
var signups = _map.GetService<SignupsData>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the SignupsData property instead of getting the service from provider.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


if (signups.Missions.Any(x =>
(x.Editing == ArmaforcesMissionBotSharedClasses.Mission.EditEnum.Started) &&
x.Owner == Context.User.Id))
Comment thread
Smieszkokoleszko marked this conversation as resolved.
{
var mission = signups.Missions.Single(x =>
(x.Editing == ArmaforcesMissionBotSharedClasses.Mission.EditEnum.Started) &&
x.Owner == Context.User.Id);

mission.Title = newTitle;

await ReplyAsync("Niech będzie...");
}
else
{
await ReplyAsync("Bez wybrania misji to dupę se edytuj. Pozdrawiam.");
}
}

[Command("zapisz-zmiany")]
[Summary("Zapisuje zmiany w aktualnie edytowanej misji, jesli w parametrze zostanie podana wartość true to zostanie wysłane ogłoszenie o zmianach w misji.")]
[ContextDMOrChannel]
Expand Down