Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Thread.new(decoy) do |decoy|
- if args[1] == "+"
- if args[2].class == String
- if args[2][/[^\d]/]
- id = getId(args[2])
- if id and !id[/[^\d]/]
- if !decoy["block"].index(id)
- decoy["block"].push(id)
- File.binwrite("filters/block.list",decoy["block"].to_s)
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"#{id} was added to blocklist.",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- else
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"#{args[2]} is already blocked.",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- end
- else
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"Invalid username: "#{args[2]}".",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- end
- else
- decoy["block"].push(args[2])
- File.binwrite("filters/block.list",decoy["block"].to_s)
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"#{args[2]} was added to blocklist.",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- end
- end
- elsif args[1] == "-"
- if args[2][/[^\d]/]
- id = getId(args[2])
- if id and !id[/[^\d]/]
- if decoy["block"].index(id)
- decoy["block"].delete(id)
- File.binwrite("filters/block.list",decoy["block"].to_s)
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"#{id} was removed from blocklist.",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- else
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"#{args[2]} is not blocked.",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- end
- else
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"Invalid username: "#{args[2]}".",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- end
- else
- decoy["block"].delete(args[2])
- File.binwrite("filters/block.list",decoy["block"].to_s)
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"#{args[2]} was removed from blocklist.",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- end
- else
- decoy["<"].print(
- packet(
- {
- "m"=>{
- "t"=>"_//block +/- ID/USERNAME",
- "u"=>"0",
- "i"=>"1"
- }
- }
- )
- )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment