summaryrefslogtreecommitdiff
path: root/src/main/java/files/Bot.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/files/Bot.java')
-rw-r--r--src/main/java/files/Bot.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/files/Bot.java b/src/main/java/files/Bot.java
index 55eff9b..dcbb64a 100644
--- a/src/main/java/files/Bot.java
+++ b/src/main/java/files/Bot.java
@@ -6,6 +6,8 @@ import com.pengrad.telegrambot.model.CallbackQuery;
import com.pengrad.telegrambot.model.Update;
import com.pengrad.telegrambot.request.SendMessage;
import com.pengrad.telegrambot.request.SendPhoto;
+import com.pengrad.telegrambot.request.SendVideo;
+import com.pengrad.telegrambot.response.SendResponse;
import java.io.FileInputStream;
import java.io.IOException;
@@ -35,15 +37,15 @@ public class Bot {
});
}
- public static void showAnimeAtMainMenu(TelegramBot telegramBot, Update update, byte index, String url, String typeOfAnime) throws IOException {
- Anime[] anime = new Anime[Parser.getAnimeAtSearchSize(url)];
+ public static void showAnimeAtMainMenu(TelegramBot telegramBot, Update update, byte index, String url, String typeOfAnime) {
+ Anime[] anime = new Anime[28];
try {
anime = Parser.getAnimeAtMainMenu(url);
} catch (IOException e) {
e.printStackTrace();
}
Anime.setList(anime);
- telegramBot.execute(new SendPhoto(update.message().chat().id(), anime[index].getImage()).caption(anime[index].showInfo()).replyMarkup(MyKeyboard.getCarousel(typeOfAnime)));
+ telegramBot.execute(new SendPhoto(UserMessage.chatId, anime[index].getImage()).caption(anime[index].showInfo()).replyMarkup(MyKeyboard.getCarousel(typeOfAnime)));
}
public static void showAnimeAtMainMenuByCallBackQuery(TelegramBot telegramBot, CallbackQuery callbackQuery, byte index, String typeOfAnime, Anime[] list) {
@@ -73,7 +75,7 @@ public class Bot {
}
public static void showRecentlyAddedAnime(TelegramBot telegramBot, Update update, byte index) throws IOException {
- showAnimeAtMainMenu(telegramBot, update, index, "https://animego.org/anime?sort=a.createdAt&direction=desc", "RecentlyAddedAnime");
+ showAnimeAtMainMenu(telegramBot, update, index, "https://anime.anidub.life/anime/anime_ongoing/", "RecentlyAddedAnime");
}
public static void showRecentlyAddedAnimeByCallBackQuery(TelegramBot telegramBot, CallbackQuery callbackQuery, byte index) {