示例#1
0
 def show_sync(self, updated_on: Arrow) -> None:
     """
     Display a message indicating the data-sync state.
     """
     if updated_on:
         self.update_activity_status(
             _('Last refresh: {}').format(updated_on.humanize()))
     else:
         self.update_activity_status(_('Waiting to refresh...'), 5000)
示例#2
0
    def _format_dates(date: arrow.Arrow) -> list[str]:
        """
        Return a list of date strings formatted according to the discord timestamp styles.

        These are used in the description of each style in the dropdown
        """
        date = date.to('utc')
        formatted = [str(int(date.timestamp()))]
        formatted += [
            date.format(format[1]) for format in list(STYLES.values())[1:7]
        ]
        formatted.append(date.humanize())
        return formatted