Bot Deletes Triggered Events from Server Log (Discord) - discord

I recently made a server clock bot that tells the time based on a set timezone. Now the problem is that because the bot makes 3 actions per minute (creates a channel, changes permission to lock/unlock that channel, and deletes that channel), our server monitor person gets infested with these 3 messages every minute. Is there a way for this bot to find its own entries and remove them from the list? Or would this just cause it to make 4 entries but 3 get deleted? The log is being monitored via ProBot if that helps any and support at ProBot has said it is not possible on their end (interface level).

The discord audit log is something nobody can change, it's intended like that. Nobody can take any administrative action without it being logged so theres always a papertrail. The only partial solution is the filtering option in the audit log, you can't exclude users/categories but at least you can select a single user/category and look at their/the categories actions without clutter.
What you could do is make your bot do its own audit logging in a channel, where it logs everything the audit log would log aside from your make-change-delete events

Related

How to correlate audit logs of Privileged Identity Management in Azure?

I am looking for a way to bundle the individual log entries inside the Privileged Identity Management audit logs by the workflow they belong to.
Every action (like request -> approval -> completion) is a separate entry in the audit logs, and simply grouping by requester and role is not helpful e.g. in case the same person requests something multiple times.
There is a CorrelationId field in every audit log but that is not the same for all steps from the workflow.
I found this in the docs, but that is not helpful for automatic processing:
Typically, the log event immediately above the approval event is an event for "Add member to role completed" where the Initiated by (actor) is the requester. In most cases, you won't need to find the requester in the approval request from an auditing perspective.
Is there another way that I am overlooking?
You could do that by using the Request Id from the Target(s). All actions (request->approval->completion) use the same Request Id.
[]

How can I have 2 users logged in at the same time in a Laravel App

Please help me architect the following case in Laravel:
Every instance of the Laravel app (ex. a company) will have a single username (super-user) who can control the sub-users. The super-user will log into the app once to allow the sub-users to log in and out many times throughout the day. The sub-users won't be able to access the app at all without the super-user logging in.
Example: A POS system that the manager logs into once a day. It doesn't log itself out all throughout the day. The cashiers simply tap in their password to gain access and it auto-logs out after 5 mins. There's a single system in the store so the cashiers have to keep switching on and off. The cashier wont be able to use the POS at all if the manager does not log in.
Im new to Laravel. I know I need multiple guards but how do I access auth so that it doesn't keep directing me to the super-user? Im thinking of using the default laravel authentication for the superuser. But what about the other users?
Any help or pointers in the right direction is highly appreciated!
Thanks!
Laravel cannot persist multiple authenticated users at once but you don't necessarily need that for this system, in fact you may be able to design a more robust system without it.
Defining the problem (rather than a solution) we'd say something like, "The system must allow for a manager to enable and disable the POS for cashiers so that they are only able to access it when authorised".
A system that achieves that goal can be built with a single Laravel authentication system, using different roles (manager, cashier) and the associated permissions. This is (fortunately) very straightforward with Laravel.
The user flow would be along the lines of:
A cashier visits the POS terminal
The cashier clicks "log in"
The cashier enters their identifying details
The system finds the user, identifies that they're a cashier, then checks if cashiers are allowed to log in
If yes, the cashier is logged in and able to access the POS functionality
If no, the cashier log in is rejected with an error
The manager flow would be along the lines of:
A manager visits the POS terminal
The manager clicks "log in"
The manager enters their identifying details
The system accepts their log in and sends them to the management dashboard
The management dashboard would be where the manager could control other users (create and manage cashiers (edit, delete, audit)) and set the system status as activated for cashiers, this would be protected with policies.
At the start of business the manager would log in to the POS and activate it for cashiers by setting the "active" flag to true, then the manager would log out. Through the day any cashier could log in and use it. At the end of the day the manager would log in and deactivate the POS for cashiers.
An added benefit of this system is that you could allow managers to also be cashiers so if they needed to use the POS during the day they would not need a separate account. A users manager status could be a simple is_manager database column. You could additionally implement programmatic scheduled POS availability, i.e: "allow log in from cashiers between 9am and 5pm".
Laravel is a great choice for this project as it provides everything you need out of the box, let me know if you have any other questions about your implementation :-)

How can I stop re-sending approvals when an item is rejected in ServiceNow

I have a SN question about workflow activities. Ideally when a user in an approval group activity rejects the item, catalog tasks are re-opened and approvals re-sent. That works fine. However, in the event that another user rejects the item, we do not want to re-open catalog tasks and re-send approvals. i.e. looping over again. We just want to keep the comments from the second, third and so on approver. Any ideas on how to obtain this functionality?
So just to understand what you're trying to accomplish:
1 user rejects, all other users approve: loop
2 or more users reject: cancel request
The easiest way to do this might be to use the workflow scratchpad and a script in the approval activity.
If you run a 'condition based on a script' in your workflow activity for the approvals, you could write to the workflow scratchpad with the actual number of rejections. Then you could use an if block to govern what happens when you leave the activity.
Alternately, you could add a condition to the approval workflow activity itself; a third option, based on the two existing ones (you can view the contents of any workflow activity condition by double-clicking on it). This would also require 'condition based on a script' to be active.

How can Zapier create Trello Cards for Closed Won Salesforce Opportunities when the Opportunity is not new?

Maybe this just isn't possible with the available Salesforce actions in Zapier, but I thought I'd ask.
You can monitor for a new opportunity, but I only want to create cards for opportunities which are closed won. So if a new opportunity is created on Monday and on Friday it is Closed Won, Zapier will never get notified when it is updated.
Seems like a very common use case, I figure someone has figured this out.
Thanks!
I took this to Zapier Support and they said....
So the tricky thing here is the "New Opportunity" trigger will only
happen when the Zap sees the record for the first time. Even if it's
updated later, the Zap will not re-trigger on it.
We do have a way to trigger on updated Salesforce records, but it
would require using their Workflow Rules and Outbound Messaging
option. Then on the Zapier side, you'd use the Salesforce "New
Outbound Message" trigger.
You basically set a workflow rule + outbound message in Salesforce.
And so all your triggering conditions (like which object/field) are on
the Salesforce side.
First you'd set up the Outbound Message, specifying the object and
fields you want to send, and the Zap url:
https://help.salesforce.com/HTViewHelpDoc?id=workflow_managing_outbound_messages.htm
Then you'd set up the Workflow Rule, specifying the conditions where
the rule should trigger, and which actions to trigger (the outbound
message action that you just made):
https://help.salesforce.com/htviewhelpdoc?id=customize_wf.htm
The one caveat here is that workflow rules are only available on some
editions of Salesforce. So you may have to check and see if your
edition supports it.
Please let me know if you have any questions about that -- happy to
help!
And that worked so yay Zapier for helping me with Salesforce!

How does Trello show users online/offline/idle state accurately?

Trello shows the information of online/offline/idle status very accurately as I personally saw. There are several solutions for tracking users online statuses, and to do so accurately requires a serious overhead. There are also the traditional problems of not knowing if a user closed the browser, disconnected etc. that cause inaccuracy in showing the offline/idle status. For a platform that does not have chat functionality (which, I believe, which would have taken the overhead of tracking users' status and therefore makes the task finally easy) how is Trello achieving this, albeit without much overhead?
Also Trello is able to detect disconnects and resume connection (not so smoothly though).
The Pushing and Polling layer of Trello is described here
Each browser tab is considered to be a session, associated with one user. Each session's activity level is tracked separately, with a user being shown with the highest activity level of all of its sessions (where active is highest, then idle, then disconnected).
Each tab periodically sends its current status to the server - every minute if it has a working WebSocket, every 5 minutes otherwise. Current status is reset to active every time the tab gains focus, or there is a keydown or mousedown event. It goes idle if it has been more than 5 minutes since the most recent of those events. The tab sends a status of disconnected in the onunload event, but we don't depend on this.
Every time a session sends its status to the server, the server looks at all of that user's sessions to determine whether that indicates a change to the user's status. If it does, it broadcasts that new status to every person watching every board that user is on (this goes through the same framework that the rest of Trello's instant updates go through, and is too complicated to explain here).
The server also checks each session to see if its been too long since we've heard from that session (2 minutes if its a WebSocket session, 10 minutes otherwise) and removes the session if it has been (removing a session indicates it is disconnected).
There are a couple of optimizations hiding in there, but that's the main story.
Trello using socket.io.. so when ever a user login it broadcast a message that user has logged in , then they show him as online.
Once he disconnects they send a message on socket again to show him offline.
Many realtime apps using socket.io for showing realtime activities.

Resources