Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function quarry(discordia, client, message, args, getLib)
- print("Quarrying...")
- local guild = client:getGuild("582232156013854740")
- local giveawayChannel = guild:getChannel("653408642304835584")
- local executesnChannel = guild:getChannel("582232156013854742")
- local executeoChannel = guild:GetChannel("")
- local entries = {}
- local giveawayTotal = 0
- local executesTotal = 0
- for i,msg in next, giveawayChannel:getMessages(100):toArray() do
- giveawayTotal = giveawayTotal + 1
- local content = msg.content
- lastId = msg.id
- local set = false
- for match in content:gmatch("%b()") do
- if not ran then
- ALIAS = match
- ran = true
- else
- IP = match
- ran = nil
- end
- end
- for i,candidate in next, entries do
- if candidate[2] == IP then
- set = true
- end
- end
- if not set then
- entry = {ALIAS,IP}
- table.insert(entries, entry)
- end
- end
- repeat
- omsg = nmsg
- for i,msg in next, giveawayChannel:getMessagesBefore(lastId,100):toArray() do
- giveawayTotal = giveawayTotal + 1
- local content = msg.content
- lastId = msg.id
- local set = false
- nmsg = msg
- for match in content:gmatch("%b()") do
- if not ran then
- ALIAS = match
- ran = true
- else
- IP = match
- ran = nil
- end
- end
- for i,candidate in next, entries do
- if candidate[2] == IP then
- set = true
- end
- end
- if not set then
- entry = {ALIAS,IP,false,0,""}
- table.insert(entries, entry)
- end
- end
- until omsg == nmsg
- for i,msg in next, executesnChannel:getMessages(100):toArray() do
- executesTotal = executesTotal + 1
- content = msg.content
- lastId = msg.id
- i = 1
- for match in content:gmatch("%b()") do
- if i == 3 then
- IP = match
- break
- end
- i = i + 1
- end
- for i,entry in next, entries do
- if entry[2] == IP then
- print("Match Found: "..entry[1])
- entry[3] = true
- entry[4] = msg.createdAt
- end
- end
- end
- repeat
- omsg = nmsg
- for i,msg in next, executesnChannel:getMessagesBefore(lastId,100):toArray() do
- executesTotal = executesTotal + 1
- content = msg.content
- lastId = msg.id
- nmsg = msg
- i = 1
- for match in content:gmatch("%b()") do
- if i == 3 then
- IP = match
- break
- end
- i = i + 1
- end
- for i,entry in next, entries do
- if entry[2] == IP then
- print("Match Found: "..entry[1])
- entry[3] = true
- entry[4] = msg.createdAt
- end
- end
- end
- print("Quarrying messages 1 ("..nmsg.timestamp.." / "..executesTotal..")")
- until omsg == nmsg
- for i,msg in next, executesoChannel:getMessages(100):toArray() do
- executesTotal = executesTotal + 1
- content = msg.content
- lastId = msg.id
- i = 1
- for match in content:gmatch("%b()") do
- if i == 3 then
- IP = match
- break
- end
- i = i + 1
- end
- for i,entry in next, entries do
- if entry[2] == IP then
- print("Match Found: "..entry[1])
- entry[3] = true
- entry[4] = msg.createdAt
- end
- end
- end
- repeat
- omsg = nmsg
- for i,msg in next, executesoChannel:getMessagesBefore(lastId,100):toArray() do
- executesTotal = executesTotal + 1
- content = msg.content
- lastId = msg.id
- nmsg = msg
- i = 1
- for match in content:gmatch("%b()") do
- if i == 3 then
- IP = match
- break
- end
- i = i + 1
- end
- for i,entry in next, entries do
- if entry[2] == IP then
- print("Match Found: "..entry[1])
- entry[3] = true
- entry[4] = msg.createdAt
- end
- end
- end
- print("Quarrying messages 2 ("..nmsg.timestamp.." / "..executesTotal..")")
- until omsg == nmsg
- -- End of quarry conclusion
- print("END OF QUARRY RESULT")
- for _,v in next, entries do
- if v[3] then
- print(v[2].." Alias: "..v[1].." "..v[4])
- end
- end
- print("NUMBER OF GIVEAWAY ENTRIES ("..giveawayTotal.."/"..#entries..")")
- end
- return quarry
- --[[ Table References
- -- giveawayTotal
- {users,ip}
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement