2022-03-19 21:19:11 +01:00

28 lines
634 B
TypeScript

import { GlobalState } from '../types';
import { InlineBotSettings } from '../../types';
export function replaceInlineBotSettings(
global: GlobalState, username: string, inlineBotSettings: InlineBotSettings | false,
): GlobalState {
return {
...global,
inlineBots: {
...global.inlineBots,
byUsername: {
...global.inlineBots.byUsername,
[username]: inlineBotSettings,
},
},
};
}
export function replaceInlineBotsIsLoading(global: GlobalState, isLoading: boolean): GlobalState {
return {
...global,
inlineBots: {
...global.inlineBots,
isLoading,
},
};
}