Пример #1
0
    public async Task <Result <FeedbackMessage> > AddNoteAsync(IUser user, string content)
    {
        var addNote = await _notes.CreateNoteAsync(_context.User.ID, user.ID, _context.GuildID.Value, content);

        if (!addNote.IsSuccess)
        {
            return(Result <FeedbackMessage> .FromError(addNote));
        }

        var note = addNote.Entity;

        await _logging.NotifyUserNoteAddedAsync(note);

        return(new FeedbackMessage($"Note added (ID {note.ID}).", _feedback.Theme.Secondary));
    }
Пример #2
0
        public async Task <RuntimeResult> AddNoteAsync(IGuildUser user, string content)
        {
            var addNote = await _notes.CreateNoteAsync(this.Context.User, user, content);

            if (!addNote.IsSuccess)
            {
                return(addNote.ToRuntimeResult());
            }

            var note = addNote.Entity;

            await _logging.NotifyUserNoteAddedAsync(note);

            return(RuntimeCommandResult.FromSuccess($"Note added (ID {note.ID})."));
        }