-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUMS.js
82 lines (73 loc) · 3.38 KB
/
UMS.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
77
78
79
80
81
82
// ==UserScript==
// @name Username Moderation Systems [UMS]
// @namespace https://github.com/philipseymourhoffman
// @version 0.95
// @description Automatically bans users with specific usernames in your kick chat
// @author psh
// @match https://kick.com/[your username here]
// @match https://kick.com/dashboard/stream
// @grant none
// ==/UserScript==
/*
* Kick.com Chat Moderator
*
* Description:
* This script automatically bans users with specified usernames containing bannable sequences in the chat on kick.com.
*
* How to Add or Remove Bannable Sequences:
* - Locate the 'bannableSequences' array in the script configuration.
* - Add or remove elements in the array to specify the sequences you want to ban.
* - Each sequence should be enclosed in single quotes and separated by commas.
* - Save the script after modifying the array.
*/
(function() {
'use strict';
// Configuration: Add or remove bannable sequences here
const bannableSequences = [,]; // Example: ['sequence1', 'sequence2', 'sequence3']
// Set to store usernames that have already triggered the action
const triggeredUsernames = new Set();
// Function to check if a username contains any bannable sequence
function containsBannableSequence(username) {
return bannableSequences.some(sequence => username.toLowerCase().includes(sequence.toLowerCase()));
}
// Function to type and send a message in chat
function typeInChat(username) {
const messageInput = document.getElementById('message-input');
if (messageInput) {
// Type the ban command character by character
const banCommand = `/ban ${username}`;
for (let i = 0; i < banCommand.length; i++) {
setTimeout(() => {
messageInput.textContent += banCommand[i];
// Dispatch input event after each character to simulate typing
const inputEvent = new Event('input', { bubbles: true });
messageInput.dispatchEvent(inputEvent);
}, i * 100); // Adjust typing speed here (time between each character)
}
// Simulate pressing the "Enter" key after typing the command
setTimeout(() => {
const enterKeyEvent = new KeyboardEvent('keydown', {
bubbles: true,
cancelable: true,
key: 'Enter'
});
messageInput.dispatchEvent(enterKeyEvent);
}, banCommand.length * 100); // Adjust delay before pressing "Enter"
}
}
// Function to monitor the chat and perform moderation
function monitorChat() {
const chatMessages = document.querySelectorAll('.chat-entry-username');
chatMessages.forEach(message => {
const username = message.textContent.trim();
if (containsBannableSequence(username) && !triggeredUsernames.has(username)) {
// Trigger the action only if the username contains a bannable sequence
// and has not already been triggered
typeInChat(username);
triggeredUsernames.add(username); // Add the username to the set of triggered usernames
}
});
}
// Run the monitoring function periodically
setInterval(monitorChat, 5000); // Adjust the interval as needed
})();