add gitignore, fix same sender issue
This commit is contained in:
parent
5aade75594
commit
ca11dbbdd4
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
*.yaml
|
||||||
|
*.pstore
|
||||||
|
spool
|
||||||
|
.bundle
|
@ -65,7 +65,7 @@ class Folder
|
|||||||
message = @submissions.sample
|
message = @submissions.sample
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
if i == 5
|
if i == 5 or message.sender == target
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
@submissions.delete(message)
|
@submissions.delete(message)
|
||||||
|
7
main.rb
7
main.rb
@ -52,13 +52,8 @@ bot.message(private: true, contains: "!folder status") do |event|
|
|||||||
end
|
end
|
||||||
|
|
||||||
bot.message(private: true) do |event|
|
bot.message(private: true) do |event|
|
||||||
(mem,au) = event.author
|
sender = event.author.id
|
||||||
i = 1
|
i = 1
|
||||||
if mem == nil
|
|
||||||
sender = au.username
|
|
||||||
else
|
|
||||||
sender = mem.username
|
|
||||||
end
|
|
||||||
event.message.attachments.each do |file|
|
event.message.attachments.each do |file|
|
||||||
res = MimeMagic.by_path(file.filename)
|
res = MimeMagic.by_path(file.filename)
|
||||||
if res != nil
|
if res != nil
|
||||||
|
Loading…
Reference in New Issue
Block a user