-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDiscordNickHandler.user.js
76 lines (73 loc) · 2.54 KB
/
DiscordNickHandler.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// ==UserScript==
// @name DiscordNickHandler
// @namespace https://raw.githubusercontent.com/danamw/discordweb/master/DiscordNickHandler.user.js
// @downloadURL https://github.com/DanaMW/DiscordWeb/raw/master/DiscordNickHandler.user.js
// @updateURL https://raw.githubusercontent.com/danamw/discordweb/master/DiscordNickHandler.user.js
// @version 0.0.22
// @description Nick Change And Color
// @author Dana l. Meli-Wischman
// @icon https://danamw.github.io/img/eyeball128.png
// @grant none
// @include /https?://discord\.com/channels/*/
// @require https://code.jquery.com/jquery-3.6.0.min.js
// @require https://raw.githubusercontent.com/uzairfarooq/arrive/master/minified/arrive.min.js
// ==/UserScript==
/* jshint esversion: 6 */
/* eslint-disable require-jsdoc */
// json.stringify store json.parse retrieve
var nickNew = {};
var nickNew = {
'narcolepticinsomniac': 'Narco',
'stonecrusher': 'NutMuncher',
'kinghat': 'crown',
'joker': 'EvilFace'
};
var nickFriend = [];
var nickFriend = ['taylia', 'narcolepticinsomniac', 'Narco', 'Mottie'];
var nickMine = [];
var nickMine = ['Dana', 'DanaMW', 'Cog', 'Cognizant'];
var nickCol = {};
var nickCol = {
'Sicuro': 'red',
'DragonSlayer': 'red',
'𝕲𝖗𝖎𝖒': 'purple',
'Saggio': 'purple',
'kinghat': 'yellow',
'Fifi': 'green'
};
$(document).arrive('span[class^="username"]', function() {
var $newElem = $(this);
var notNick = $(this).text();
if (nickNew[notNick] != null) {
var isNick = nickNew[notNick];
$newElem.text(isNick);
}
if ($.inArray(notNick, nickFriend) != -1) {
$newElem.attr('style', 'color: blue !important;');
}
if ($.inArray(notNick, nickMine) != -1) {
$newElem.attr('style', 'color: red !important;');
}
if (nickCol[notNick] != null) {
var isCol = nickCol[notNick];
$newElem.attr('style', 'color: ' + isCol + ' !important;');
}
});
$(document).arrive('span[class^="roleColor"]', function() {
var $newElem = $(this);
var notNick = $(this).text();
if (nickNew[notNick] != null) {
var isNick = nickNew[notNick];
$newElem.text(isNick);
}
if ($.inArray(notNick, nickFriend) != -1) {
$newElem.attr('style', 'color: blue !important;');
}
if ($.inArray(notNick, nickMine) != -1) {
$newElem.attr('style', 'color: red !important;');
}
if (nickCol[notNick] != null) {
var isCol = nickCol[notNick];
$newElem.attr('style', 'color: ' + isCol + ' !important;');
}
});