Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const watchlistKeyboard = (translation: I18n): InlineKeyboardMarkup => {
const firstLine = [
Markup.callbackButton(translation.t('airingButton'), 'MENU/ANIME-RELEASING/0'),
Markup.callbackButton(translation.t('soonButton'), 'MENU/ANIME-SOON/0'),
Markup.callbackButton(translation.t('completedButton'), 'MENU/ANIME-COMPLETED/0'),
Markup.callbackButton(translation.t('cancelledButton'), 'MENU/ANIME-CANCELLED/0')
];
const secondLine = [
Markup.callbackButton(translation.t('moreInfoButton'), 'MENU/ANIME-MORE-INFO/0')
];
const thirdLine = [
Markup.callbackButton('<', 'MENU/MENU/0')
];
return Markup.inlineKeyboard([ firstLine, secondLine, thirdLine ]);
};
export const userKeyboard = (translation: I18n): InlineKeyboardMarkup => {
const firstLine = [
Markup.callbackButton(translation.t('languageButton'), 'MENU/LANGUAGE/0'),
Markup.callbackButton(translation.t('notifyButton'), 'MENU/NOTIFY/0')
];
const secondLine = [
Markup.callbackButton(translation.t('timeButton'), 'MENU/TIME/0'),
Markup.callbackButton(translation.t('locationButton'), 'MENU/LOCATION/0')
];
const thirdLine = [
Markup.callbackButton('<', 'MENU/MENU/0')
];
return Markup.inlineKeyboard([ firstLine, secondLine, thirdLine ]);
};
export const mangaMoreKeyboard = ({ id, translation }: IMoreKeyboard): InlineKeyboardMarkup => {
const firstLine = [
Markup.callbackButton(translation.t('buttonDescription'), `ANILIST/MANGA/DESCRIPTION/${id}`),
Markup.callbackButton(translation.t('buttonGenres'), `ANILIST/MANGA/GENRES/${id}`),
Markup.callbackButton(translation.t('buttonRemove'), `LIST/READ/UNSUBSCRIBE/${id}`)
];
const secondLine = [
Markup.callbackButton(translation.t('buttonNotify'), `LIST/READ/NOTIFY/${id}`)
];
return Markup.inlineKeyboard([ firstLine, secondLine ]);
};
export const languageKeyboard = (translation: I18n): InlineKeyboardMarkup => {
const languages = [
Markup.callbackButton(translation.t('arButton'), 'USER/LANGUAGE/ARABIC'),
Markup.callbackButton(translation.t('zhButton'), 'USER/LANGUAGE/CHINESE'),
Markup.callbackButton(translation.t('deButton'), 'USER/LANGUAGE/DEUTSCH'),
Markup.callbackButton(translation.t('nlButton'), 'USER/LANGUAGE/DUTCH'),
Markup.callbackButton(translation.t('enButton'), 'USER/LANGUAGE/ENGLISH'),
Markup.callbackButton(translation.t('deButton'), 'USER/LANGUAGE/GERMAN'),
Markup.callbackButton(translation.t('ruButton'), 'USER/LANGUAGE/RUSSIAN'),
Markup.callbackButton(translation.t('frButton'), 'USER/LANGUAGE/FRENCH'),
Markup.callbackButton(translation.t('idButton'), 'USER/LANGUAGE/INDONESIAN'),
Markup.callbackButton(translation.t('jpButton'), 'USER/LANGUAGE/JAPANESE'),
Markup.callbackButton(translation.t('ptButton'), 'USER/LANGUAGE/PORTUGUESE'),
Markup.callbackButton(translation.t('esButton'), 'USER/LANGUAGE/SPANISH')
];
const back = [
Markup.callbackButton('<', 'USER/ALL')
];
return Markup.inlineKeyboard(languages.concat(back).map(line => [ line ]));
};
export const timeHourKeyboard = (period: Period): InlineKeyboardMarkup => {
const firstLine = [
Markup.callbackButton('1h', `USER/HOUR/${calculatePeriod({ hour: 1, period })}`),
Markup.callbackButton('2h', `USER/HOUR/${calculatePeriod({ hour: 2, period })}`),
Markup.callbackButton('3h', `USER/HOUR/${calculatePeriod({ hour: 3, period })}`)
];
const secondLine = [
Markup.callbackButton('4h', `USER/HOUR/${calculatePeriod({ hour: 4, period })}`),
Markup.callbackButton('5h', `USER/HOUR/${calculatePeriod({ hour: 5, period })}`),
Markup.callbackButton('6h', `USER/HOUR/${calculatePeriod({ hour: 6, period })}`)
];
const thirdLine = [
Markup.callbackButton('7h', `USER/HOUR/${calculatePeriod({ hour: 7, period })}`),
Markup.callbackButton('8h', `USER/HOUR/${calculatePeriod({ hour: 8, period })}`),
Markup.callbackButton('9h', `USER/HOUR/${calculatePeriod({ hour: 9, period })}`)
];
const fourthLine = [
Markup.callbackButton('10h', `USER/HOUR/${calculatePeriod({ hour: 10, period })}`),
Markup.callbackButton('11h', `USER/HOUR/${calculatePeriod({ hour: 11, period })}`),
Markup.callbackButton('12h', `USER/HOUR/${calculatePeriod({ hour: 12, period })}`)
];
const fifthLine = [
Markup.callbackButton('<', 'USER/PERIOD')
];
return Markup.inlineKeyboard([firstLine, secondLine, thirdLine, fourthLine, fifthLine]);
};
Markup.callbackButton('3h', `USER/HOUR/${calculatePeriod({ hour: 3, period })}`)
];
const secondLine = [
Markup.callbackButton('4h', `USER/HOUR/${calculatePeriod({ hour: 4, period })}`),
Markup.callbackButton('5h', `USER/HOUR/${calculatePeriod({ hour: 5, period })}`),
Markup.callbackButton('6h', `USER/HOUR/${calculatePeriod({ hour: 6, period })}`)
];
const thirdLine = [
Markup.callbackButton('7h', `USER/HOUR/${calculatePeriod({ hour: 7, period })}`),
Markup.callbackButton('8h', `USER/HOUR/${calculatePeriod({ hour: 8, period })}`),
Markup.callbackButton('9h', `USER/HOUR/${calculatePeriod({ hour: 9, period })}`)
];
const fourthLine = [
Markup.callbackButton('10h', `USER/HOUR/${calculatePeriod({ hour: 10, period })}`),
Markup.callbackButton('11h', `USER/HOUR/${calculatePeriod({ hour: 11, period })}`),
Markup.callbackButton('12h', `USER/HOUR/${calculatePeriod({ hour: 12, period })}`)
];
const fifthLine = [
Markup.callbackButton('<', 'USER/PERIOD')
];
return Markup.inlineKeyboard([firstLine, secondLine, thirdLine, fourthLine, fifthLine]);
};
export const menuKeyboard = (translation: I18n): InlineKeyboardMarkup => {
const firstLine = [
Markup.callbackButton(translation.t('userButton'), 'USER/ALL'),
Markup.callbackButton(translation.t('countdownButton'), 'COUNTDOWN'),
Markup.callbackButton(translation.t('guideButton'), 'GUIDE')
];
const secondLine = [
Markup.callbackButton(translation.t('watchlistButton'), 'MEDIA/WATCH/ALL'),
Markup.callbackButton(translation.t('readlistButton'), 'MEDIA/READ/ALL')
];
const thirdLine = [
Markup.callbackButton(translation.t('counterButton'), 'COUNTER')
];
const fourthLine = [
Markup.callbackButton(translation.t('recommendationButton'), 'RECOMMENDATION')
];
return Markup.inlineKeyboard([ firstLine, secondLine, thirdLine, fourthLine ]);
};
export const timeHourKeyboard = (period: Period): InlineKeyboardMarkup => {
const firstLine = [
Markup.callbackButton('1h', `USER/HOUR/${calculatePeriod({ hour: 1, period })}`),
Markup.callbackButton('2h', `USER/HOUR/${calculatePeriod({ hour: 2, period })}`),
Markup.callbackButton('3h', `USER/HOUR/${calculatePeriod({ hour: 3, period })}`)
];
const secondLine = [
Markup.callbackButton('4h', `USER/HOUR/${calculatePeriod({ hour: 4, period })}`),
Markup.callbackButton('5h', `USER/HOUR/${calculatePeriod({ hour: 5, period })}`),
Markup.callbackButton('6h', `USER/HOUR/${calculatePeriod({ hour: 6, period })}`)
];
const thirdLine = [
Markup.callbackButton('7h', `USER/HOUR/${calculatePeriod({ hour: 7, period })}`),
Markup.callbackButton('8h', `USER/HOUR/${calculatePeriod({ hour: 8, period })}`),
Markup.callbackButton('9h', `USER/HOUR/${calculatePeriod({ hour: 9, period })}`)
];
const fourthLine = [
Markup.callbackButton('10h', `USER/HOUR/${calculatePeriod({ hour: 10, period })}`),
Markup.callbackButton('11h', `USER/HOUR/${calculatePeriod({ hour: 11, period })}`),
Markup.callbackButton('12h', `USER/HOUR/${calculatePeriod({ hour: 12, period })}`)
];
const fifthLine = [
Markup.callbackButton('<', 'USER/PERIOD')
];
return Markup.inlineKeyboard([firstLine, secondLine, thirdLine, fourthLine, fifthLine]);
};
export const userKeyboard = (translation: I18n): InlineKeyboardMarkup => {
const firstLine = [
Markup.callbackButton(translation.t('languageButton'), 'MENU/LANGUAGE/0'),
Markup.callbackButton(translation.t('notifyButton'), 'MENU/NOTIFY/0')
];
const secondLine = [
Markup.callbackButton(translation.t('timeButton'), 'MENU/TIME/0'),
Markup.callbackButton(translation.t('locationButton'), 'MENU/LOCATION/0')
];
const thirdLine = [
Markup.callbackButton('<', 'MENU/MENU/0')
];
return Markup.inlineKeyboard([ firstLine, secondLine, thirdLine ]);
};