Let me remind you that my purpose of asking you to help code is:

1. I have 2 text files:
+ (1) atb_reason.txt (in this file there are about 10 reasons kick from reason1 to reason10 I have preset, one reason per line);

+ (2) atb_database.txt (in this file will save the data about [id kicknumber],NickNameOfKick,AddressIP/HOST,ReasonKick), if any NickName or AddressIp/HOST is in there, entering the room will be banned and kicked with ReasonKick and this [id: kicknumber]. I mean when you kick and ban with 1 id and 1 reason kick, the next time MyBot will kicked and banned with the correct id and reason kick before.

+ Example: When I type the command:!b NickName, MyBot will ban IP/HOST and kick with random reasons (For example kick with reason3 and id is 1234: Please benice if you don't want to get a face of ban [id: 1234])

+ After kicking and ban MyBot will automatically save to the file atb_database.txt as follows: [id: 1234], NickName, *!*@ IP/HOST, Please benice if you don't want to get a face of ban. Next time, if NickName or IP/HOST this join room will join the room will be auto kick and ban with this id and kick reason.

2. Regarding the add/del/list commands I have the following comments:

2.1. Command:!b <nick> [reason] <== I want this command when there is no reason, MyBot will automatically random reason from atb_reason.txt. If there is reason, MyBot will save
the reason in the file atb_database.txt as mentioned in point 1 above.

2.2. The command:!badd <nick> <host> [id] [reason] can be edited in the following order to make it easier to remember:!badd <nick> <host defautl *!*@ Host> [reason] [id]. Example:!badd BadNick *!*@10.11.12.13 You are badchatter not welcome here [id: 9999]

2.3. Command:!bdel <nick|mask|id> <=== When typing 1 of these 3, MyBot will automatically delete all information about nick|mask|id in the file atb_database.txt. And the next time that Nick or Mask enters the room, he/she will not be kicked/banned again.

2.4. Commands:!bfind and !blist I like and have no idea about this command. I like it very much.

2.5. In your example image, I see that the reason kick and id kick are not the same. I want the following kicks to have the reason and id as the first time I was kicked/ban.

https://i.ibb.co/3SwWTcs/Akick-Temp-Ban.png

Hope you research and code perfectly according to my opinion above. I sincerely thank you and wish you good health, happiness and peace.

P/S: THIS IS MY TEST ON YOUR CODE: IT WRONG
I use command: Add user to database: !badd <nick> <host> [id] [reason] ==> !badd nicktest *!*@42.118.MLUE.VR6V 9876 Testing for Epic code

Here is the result:

[20:22:57] * nicktest (DVQ@216.244.ULQT.38V9) joins #lobby
[20:22:59] * MyBot sets mode: +b *!*@216.244.ULQT.38V9
[20:22:59] * nicktest was kicked from #lobby by MyBot ([Banned] (reason: [Banned] (reason: You are no longer welcome here) [id:9876];nicktest;*!*@42.118.MLUE.VR6V;#test;Testing for Epic code)

ANTHER TEST: WITH COMMAND: !b <nick> [reason]
The result:
[20:30:49] <@ChanGuard> !b nickVSA Testing for Epic code script
[20:30:50] * Kendy sets mode: +b *!*@216.244.ULQT.38V9
[20:30:50] * nickVSA was kicked from #test by Kendy (😈 Testing for Epic code script [id:VA45793])
[20:30:57] * ChanGuard sets mode: +l 7
[20:31:22] * Kendy sets mode: -b *!*@216.244.ULQT.38V9
[20:31:33] * nickVSA (DVQ@216.244.ULQT.38V9) joins #test
[20:31:34] * Kendy sets mode: +b *!*@216.244.ULQT.38V9
[20:31:34] * nickVSA was kicked from #test by Kendy ([Banned] (reason: [Banned] (reason: You are no longer welcome here) [id:VA45793];nickVSA;*!*@216.244.ULQT.38V9;#test;😈 Testing for Epic code script)

Last edited by Robert; 08/05/21 01:33 PM.