View difference between Paste ID: xiUdQ5hk and TuKzjM59
SHOW: | | - or go back to the newest paste.
1-
a=["has been following","for","years","year","months","month","weeks","week","days","day","hours","hour","minutes","minute","seconds","second","is not following"];
1+
a=["has been following","for","days","day"];
2-
b=["подписан на","уже","г","г","мес","мес","нед","нед","дн","дн","ч","ч","мин","мин","сек","сек","не подписан на"];
2+
b=["подписан на канал","уже","дней","день"];
3
for(i=0;i<a.length;i++){
4
	t=t.replace(a[i], b[i]);
5
}
6-
if(t.includes('не подписан')){
6+
if(t.includes('is not following')){
7
	if(t.split(' ')[0] === '@h1kh'){
8
        unsub = 'H1kH является владельцем данного канала EZ';
9
    }
10
	else{
11
        emotes = ['NotLikeThis', 'PoroSad', 'BibleThump', 'peepoSad'];
12
        unsub=t.split(' ')[0] + ' не подписан на канал ' + emotes[Math.floor(Math.random() * emotes.length)];
13
    }
14
	t=unsub;
15
}
16
17
t_split = t.split(' ');
18
days = t_split[t_split.length - 2];
19
if(days%100 >= 11 && days%100 <= 14){
20
	t=t.replace('дней','дней');
21
}
22
else{
23
	switch(days%10){
24
        case 1:
25
            t=t.replace('дней', 'день');
26
            break;
27
        case 2:
28
        case 3:
29
        case 4:
30
            t=t.replace('дней','дня');
31
            break;
32
        default:
33
            t=t.replace('дней','дней');
34
            break;
35
    }
36
}
37
38
if(t.includes('@h1kh уже')){
39
    t=t.replace('@h1kh', 'Хика');
40
}
41
if (t.toLowerCase().includes('could not find a twitch account')){
42
    t='Не удалось найти пользователя -> ' + t.split(' ').pop();
43
}
44
if (t.toLowerCase().includes('could not get users from twitch api')){
45
	t='Не удалось получить пользователей из Twitch API, имя пользователя недействительно -> ' + t.split(' ').pop();
46
}
47
if (t.toLowerCase().includes('remote server')){
48
	t='Ошибка сервера 404: пользователь не найден.';
49
}
50